arc: offlinemode rework

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-07-06 10:45:06 +02:00
parent 4ad6f52ed9
commit ea9c7526d2
2 changed files with 43 additions and 39 deletions

View File

@ -1193,9 +1193,9 @@ else
x) backupMenu; NEXT="x" ;;
M) arcNIC; NEXT="M" ;;
9) [ "${OFFLINE}" == "true" ] && OFFLINE='false' || OFFLINE='true'
[ "${OFFLINE}" == "false" ] && offlineCheck
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
offlineCheck "${OFFLINE}"
ARCNIC="$(readConfigKey "arc.nic" "${USER_CONFIG_FILE}")"
OFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
NEXT="9"
;;
y) keymapMenu; NEXT="y" ;;

View File

@ -539,8 +539,13 @@ function ntpCheck() {
# Offline Check
function offlineCheck() {
CNT=0
ARCNIC=""
AUTOMATED="$(readConfigKey "arc.automated" "${USER_CONFIG_FILE}")"
local ARCNIC=""
local OFFLINE="${1}"
if [ "${OFFLINE}" == "true" ]; then
ARCNIC="offline"
OFFLINE="true"
elif [ "${OFFLINE}" == "false" ]; then
while true; do
NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
CNT=$((${CNT} + 1))
@ -576,10 +581,9 @@ function offlineCheck() {
ARCNIC="offline"
OFFLINE="true"
fi
fi
writeConfigKey "arc.nic" "${ARCNIC}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.offline" "${OFFLINE}" "${USER_CONFIG_FILE}"
ARCNIC="$(readConfigKey "arc.nic" "${USER_CONFIG_FILE}")"
OFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
}
###############################################################################