From b2538b24ef6a5038113c1fa6f210e4f5ddf59434 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sun, 17 Nov 2024 16:22:53 +0100 Subject: [PATCH] tree: cleanup Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 58 +++++---------------------- files/initrd/opt/arc/arc.sh | 4 +- 2 files changed, 11 insertions(+), 51 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 1a7050d3..9f855f92 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -2255,28 +2255,19 @@ function getpatfiles() { function genHardwareID() { HWID="$(genHWID)" while true; do - if [ -n "${HWID}" ]; then - USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" - if echo "${USERID}" | grep -vq "Hardware ID"; then - dialog --backtitle "$(backtitle)" --title "HardwareID" \ - --msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!" 6 70 - writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}" - writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}" - break - else - dialog --backtitle "$(backtitle)" --title "HardwareID" \ - --yes-label "Retry" --no-label "Cancel" --yesno "HardwareID: ${HWID}\nRegister your HardwareID on\nhttps://arc.auxxxilium.tech (Discord Account needed).\nPress Retry after you registered it." 8 60 - [ $? -ne 0 ] && USERID="" && break - writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}" - writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}" - fi + USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" + if echo "${USERID}" | grep -vq "Hardware ID"; then + dialog --backtitle "$(backtitle)" --title "HardwareID" \ + --msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!" 6 70 + writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}" + writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}" + break else dialog --backtitle "$(backtitle)" --title "HardwareID" \ - --msgbox "HardwareID: ID Generation failed!" 6 50 - USERID="" + --yes-label "Retry" --no-label "Cancel" --yesno "HardwareID: ${HWID}\nRegister your HardwareID on\nhttps://arc.auxxxilium.tech (Discord Account needed).\nPress Retry after you registered it." 8 60 + [ $? -ne 0 ] && USERID="" && break writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}" writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}" - break fi done return @@ -2285,37 +2276,6 @@ function genHardwareID() { ############################################################################### # Check HardwareID function checkHardwareID() { - HWID="$(genHWID)" - USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" - if echo "${USERID}" | grep -vq "Hardware ID"; then - [ ! -f "${S_FILE}" ] && cp -f "${S_FILE}" "${S_FILE}.bak" 2>/dev/null || true - if curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}&userid=${USERID}" -o "${S_FILE}" 2>/dev/null; then - writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}" - writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}" - else - dialog --backtitle "$(backtitle)" --title "HardwareID" \ - --infobox "HardwareID: Your HardwareID couldn't be verified!" 4 50 - sleep 3 - USERID="" - writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}" - writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}" - mv -f "${S_FILE}.bak" "${S_FILE}" 2>/dev/null - fi - else - dialog --backtitle "$(backtitle)" --title "HardwareID" \ - --infobox "HardwareID: Your HardwareID isn't registered!" 4 50 - sleep 3 - USERID="" - writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}" - writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}" - mv -f "${S_FILE}.bak" "${S_FILE}" 2>/dev/null - fi - return -} - -############################################################################### -# Check HardwareID -function checkHardwareIDsilence() { HWID="$(genHWID)" USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" [ ! -f "${S_FILE}.bak" ] && cp -f "${S_FILE}" "${S_FILE}.bak" 2>/dev/null || true diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 025adba4..5c6c1b19 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -92,7 +92,7 @@ function arcModel() { if [ ! -f "${S_FILE}" ] || [ ! -f "${P_FILE}" ]; then updateConfigs else - checkHardwareIDsilence + checkHardwareID fi dialog --backtitle "$(backtitlep)" --title "Model" \ --infobox "Reading Models..." 3 25 @@ -957,7 +957,7 @@ else b) addonMenu; NEXT="b" ;; d) modulesMenu; NEXT="d" ;; e) ONLYVERSION="true" && arcVersion; NEXT="e" ;; - p) ONLYPATCH="true" && checkHardwareIDsilence && arcPatch; NEXT="p" ;; + p) ONLYPATCH="true" && checkHardwareID && arcPatch; NEXT="p" ;; S) storageMenu; NEXT="S" ;; o) dtsMenu; NEXT="o" ;; g) governorMenu; NEXT="g" ;;