mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-23 22:09:53 +07:00
tree: add some sanity check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
5fa2c3a1c6
commit
5f030c2349
@ -1229,7 +1229,7 @@ function getCMDline () {
|
||||
function uploadDiag () {
|
||||
if [ -f "${TMP_PATH}/sysinfo.yml" ]; then
|
||||
HWID="$(genHWID)"
|
||||
curl -sk -X POST -F "file=@${TMP_PATH}/sysinfo.yml" "https://arc.auxxxilium.tech?sysinfo=${HWID}&userid=${USERID}" 2>/dev/null
|
||||
curl -sk -m 20 -X POST -F "file=@${TMP_PATH}/sysinfo.yml" "https://arc.auxxxilium.tech?sysinfo=${HWID}&userid=${USERID}" 2>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "Your Code: ${HWID}" 5 40
|
||||
else
|
||||
@ -2288,7 +2288,7 @@ 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
|
||||
cp -f "${S_FILE}" "${S_FILE}.bak"
|
||||
[ ! -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}"
|
||||
@ -2299,6 +2299,7 @@ function checkHardwareID() {
|
||||
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" \
|
||||
@ -2307,6 +2308,7 @@ function checkHardwareID() {
|
||||
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
|
||||
}
|
||||
|
@ -92,8 +92,6 @@ function arcModel() {
|
||||
if [ ! -f "${S_FILE}" ] || [ ! -f "${P_FILE}" ]; then
|
||||
updateConfigs
|
||||
fi
|
||||
# Check for Hardware ID
|
||||
checkHardwareID
|
||||
dialog --backtitle "$(backtitlep)" --title "Model" \
|
||||
--infobox "Reading Models..." 3 25
|
||||
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
|
||||
|
@ -362,7 +362,7 @@ function updateConfigs() {
|
||||
dialog --backtitle "$(backtitle)" --title "Update Configs" \
|
||||
--infobox "Update successful!" 3 50
|
||||
sleep 2
|
||||
[ -z "${USERID}" ] && checkHardwareID || true
|
||||
[ -n "${USERID}" ] && checkHardwareID || true
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user