From cf2daa98077d36b2cd98ba7a8dacca0ef214ecfd Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sat, 16 Nov 2024 19:01:58 +0100 Subject: [PATCH] networkdiag: add useridapi check Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index ab27b927..035dcc7b 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -1281,14 +1281,21 @@ function networkdiag() { fi done echo - GITHUBAPI=$(curl --interface ${N} -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1 2>/dev/null) + HWID="$(genHWID)" + USERIDAPI="$(curl --interface ${N} -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" + if [[ $? -ne 0 || -z "${USERIDAPI}" ]]; then + echo -e "Arc UserID API not reachable!" + else + echo -e "Arc UserID API reachable! (${USERIDAPI})" + fi + GITHUBAPI=$(curl --interface ${N} -skL -m 10 "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1 2>/dev/null) if [[ $? -ne 0 || -z "${GITHUBAPI}" ]]; then echo -e "Github API not reachable!" else echo -e "Github API reachable!" fi if [ "${CONFDONE}" == "true" ]; then - SYNOAPI=$(curl --interface ${N} -m 5 -skL "https://www.synology.com/api/support/findDownloadInfo?lang=en-us&product=${MODEL/+/%2B}&major=${PRODUCTVER%%.*}&minor=${PRODUCTVER##*.}" | jq -r '.info.system.detail[0].items[0].files[0].url') + SYNOAPI=$(curl --interface ${N} -skL -m 10 "https://www.synology.com/api/support/findDownloadInfo?lang=en-us&product=${MODEL/+/%2B}&major=${PRODUCTVER%%.*}&minor=${PRODUCTVER##*.}" | jq -r '.info.system.detail[0].items[0].files[0].url') if [[ $? -ne 0 || -z "${SYNOAPI}" ]]; then echo -e "Syno API not reachable!" else