From c718f77dcd4424fb749e5a928b10ef358bdb10a4 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Thu, 21 Mar 2024 19:59:49 +0100 Subject: [PATCH] arc: add offline check and move storagemap command Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 1 - files/initrd/opt/arc/arc.sh | 12 ++++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 54c5eaca..35cb6140 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -1733,7 +1733,6 @@ function credits() { TEXT+="\n\Z4>> Based on:\Zn" TEXT+="\n Redpill: \ZbTTG / Pocopico\Zn" TEXT+="\n ARPL/RR: \Zbfbelavenuto / wjz304\Zn" - TEXT+="\n NVMe Scripts: \Zb007revad\Zn" TEXT+="\n NVMe System: \Zbjim3ma\Zn" TEXT+="\n System: \ZbBuildroot 2023.08.x\Zn" TEXT+="\n DSM: \ZbSynology Inc.\Zn" diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 03346817..f2c63aa0 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -35,8 +35,15 @@ fi # Get Loader Disk Bus BUS=$(getBus "${LOADER_DISK}") -# Get Portmap for Loader -getmap +# Offline Mode check +OFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")" +if [ "${OFFLINE}" = "false" ]; then + if ping -c 1 "github.com" &> /dev/null; then + writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}" + else + writeConfigKey "arc.offline" "true" "${USER_CONFIG_FILE}" + fi +fi # Get DSM Data from Config MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" @@ -367,6 +374,7 @@ function arcsettings() { --infobox "Network Config..." 3 30 getnet # Select Portmap for Loader (nonDT) + getmap if [[ "${DT}" = "false" && $(lspci -d ::106 | wc -l) -gt 0 ]]; then dialog --backtitle "$(backtitle)" --colors --title "Storage Map" \ --infobox "Storage Map..." 3 30