arc: add offline check

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-10-27 18:30:22 +01:00
parent 39b95a840a
commit 6dfce5cc1b

View File

@ -266,6 +266,7 @@ function arcVersion() {
PAT_URL=""
PAT_HASH=""
URLVER=""
if [ "${ARCOFFLINE}" == "false" ]; then
while true; do
PJ="$(python ${ARC_PATH}/include/functions.py getpats4mv -m "${MODEL}" -v "${PRODUCTVER}")"
if [[ -z "${PJ}" || "${PJ}" == "{}" ]]; then
@ -302,6 +303,7 @@ function arcVersion() {
[ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ] && VALID="true" && break
fi
done
fi
if [ -z "${PAT_URL}" ] || [ -z "${PAT_HASH}" ]; then
MSG="Failed to get PAT Data.\n"
MSG+="Please manually fill in the URL and Hash of PAT.\n"
@ -346,7 +348,7 @@ function arcVersion() {
PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
if [ "${PAT_HASH}" != "${PAT_HASH_CONF}" ] || [ "${PAT_URL}" != "${PAT_URL_CONF}" ]; then
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" >/dev/null 2>&1 || true
rm -f "${PART1_PATH}/grub_cksum.syno" "${PART1_PATH}/GRUB_VER" "${PART2_PATH}/"* >/dev/null 2>&1 || true
rm -f "${PART1_PATH}/grub_cksum.syno" "${PART1_PATH}/GRUB_VER" >/dev/null 2>&1 || true
rm -f "${USER_UP_PATH}/"*.tar >/dev/null 2>&1 || true
fi
getpatfiles