|
16 | 16 | #██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██║ ██║ ██╔════╝██╔══██╗ SomeWhereOverTheRainBow # |
17 | 17 | #██║██╔██╗ ██║███████╗ ██║ ███████║██║ ██║ █████╗ ██████╔╝ Contributors: # |
18 | 18 | #██║██║╚██╗██║╚════██║ ██║ ██╔══██║██║ ██║ ██╔══╝ ██╔══██╗ JackYaz,gspannu,thelonelycoder # |
19 | | -#██║██║ ╚████║███████║ ██║ ██║ ██║███████╗███████╗███████╗██║ ██║ v1.9.1 # |
| 19 | +#██║██║ ╚████║███████║ ██║ ██║ ██║███████╗███████╗███████╗██║ ██║ v1.9.2 # |
20 | 20 | #╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═╝ # |
21 | 21 | ################################################################################################################# |
22 | 22 |
|
|
28 | 28 | export LC_ALL=C |
29 | 29 | export PATH="/sbin:/bin:/usr/sbin:/usr/bin:${PATH}" |
30 | 30 |
|
31 | | -AI_VERSION="v1.9.1" |
| 31 | +AI_VERSION="v1.9.2" |
32 | 32 | export AI_VERSION |
33 | 33 | readonly API_FILE="/tmp/AGH_GIT_API_$$.json" |
34 | 34 | readonly LATEST_URL="https://api.github.com/repos/AdguardTeam/AdGuardHome/releases" |
35 | | -if openssl version | grep -q "1.1.1"; then |
36 | | - API_AUTH="$(printf "%s\n" "U2FsdGVkX193tvNAm/h0gqP8WFAbXP6rvJH+2ydlGOgX4nVc0jt4pVLTZhchaAvA" | openssl enc -aes-256-cbc -d -base64 -pass pass:adguardhome -pbkdf2)" |
37 | | - API_SECRET="$(printf "%s\n" "U2FsdGVkX1/o/jNigvt2vDaQ8cn+8zHIxbS2NUKKCjMrPGCq3b1HIDE0f8q3gDXe8SxfTh9HQcxxnR2grWBwuwkTqwbAcE7okW4EHMHVpTXRNthxm2RYkNLFIrRKYDP0rLbdd7/g28c3trlPGqc9ng==" | openssl enc -aes-256-cbc -d -base64 -pass pass:adguardhome -pbkdf2)" |
38 | | - API_HEADER="-H "\""${API_AUTH} ${API_SECRET}"\""" |
39 | | -fi |
40 | 35 | varcnt=0 |
41 | 36 | readonly MAX_RETRIES="1" |
42 | 37 | until [ -n "${REMOTE_VER}" ] && [ -n "${REMOTE_BETA}" ]; do |
43 | | - if [ "${varcnt}" -lt "${MAX_RETRIES}" ] || { [ "${varcnt}" -eq "${MAX_RETRIES}" ] && [ -z "${API_HEADER}" ]; }; then |
44 | | - curl -D /tmp/$$_headers.out --retry 3 --connect-timeout 3 --retry-delay 1 --max-time $((3 * 5)) --retry-connrefused -sL "${LATEST_URL}?per_page=5" -o "${API_FILE}" |
45 | | - elif { [ "${varcnt}" -eq "${MAX_RETRIES}" ] && [ -n "${API_HEADER}" ]; }; then |
46 | | - curl -D /tmp/$$_headers.out --retry 3 --connect-timeout 3 --retry-delay 1 --max-time $((3 * 5)) --retry-connrefused -sL "${LATEST_URL}?per_page=5" -o "${API_FILE}" "${API_HEADER}" |
47 | | - elif [ "${varcnt}" -gt "${MAX_RETRIES}" ]; then |
48 | | - printf "%s\n" "One or more critical variables could not be set in a timely manner." "It is possible we have hit the github api ratelimit (60req./hr), and our token work around did not work (5000req./hr)." "For more information, please read /tmp/$$_headers.out." "Please be sure to check your internet connection, and please try again later." "The installer script will now exit." |
| 38 | + curl -D /tmp/$$_headers.out --retry 3 --connect-timeout 3 --retry-delay 1 --max-time $((3 * 5)) --retry-connrefused -sL "${LATEST_URL}?per_page=5" -o "${API_FILE}" |
| 39 | + if [ -s "${API_FILE}" ]; then |
| 40 | + REMOTE_VER="$(awk '/"tag_name":/ {t=$2} /"prerelease": false/ {gsub(/[",]/,"",t); print t; exit}' "${API_FILE}")" |
| 41 | + REMOTE_BETA="$(awk '/"tag_name":/ {t=$2} /"prerelease": true/ {gsub(/[",]/,"",t); print t; exit}' "${API_FILE}")" |
| 42 | + break |
| 43 | + fi |
| 44 | + if [ "${varcnt}" -gt "${MAX_RETRIES}" ]; then |
| 45 | + printf "%s\n" "One or more critical variables could not be set in a timely manner." "It is possible we have hit the github api ratelimit (60req./hr) per requesters IP." "For more information, please read /tmp/$$_headers.out." "Please be sure to check your internet connection, and please try again later." "The installer script will now exit." |
49 | 46 | sleep 3s |
50 | 47 | exit 1 |
51 | 48 | fi |
52 | | - if [ -z "${REMOTE_VER}" ] && [ -f "${API_FILE}" ]; then REMOTE_VER="$(awk '/"tag_name":/ {t=$2} /"prerelease": false/ {gsub(/[",]/,"",t); print t; exit}' "${API_FILE}")"; fi |
53 | | - if [ -z "${REMOTE_BETA}" ] && [ -f "${API_FILE}" ]; then REMOTE_BETA="$(awk '/"tag_name":/ {t=$2} /"prerelease": true/ {gsub(/[",]/,"",t); print t; exit}' "${API_FILE}")"; fi |
54 | 49 | varcnt="$((varcnt + 1))" |
55 | 50 | done |
56 | 51 | rm -rf "$API_FILE" "/tmp/$$_headers.out" |
|
0 commit comments