Update version.sh

This commit is contained in:
itsmesid 2022-03-10 07:10:08 +05:30 committed by GitHub
parent 1d2135a602
commit 6958884e9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,6 +90,7 @@ getRemoteVersion(){
local version
local cachedVersions
local arrCache
local owner="pi-hole"
cachedVersions="/etc/pihole/GitHubVersions"
#If the above file exists, then we can read from that. Prevents overuse of GitHub API
@ -105,7 +106,11 @@ getRemoteVersion(){
return 0
fi
version=$(curl --silent --fail "https://api.github.com/repos/pi-hole/${daemon}/releases/latest" | \
if [[ "$daemon" == "AdminLTE" ]]; then
owner="arevindh"
fi
version=$(curl --silent --fail "https://api.github.com/repos/${owner}/${daemon}/releases/latest" | \
awk -F: '$1 ~/tag_name/ { print $2 }' | \
tr -cd '[[:alnum:]]._-')
if [[ "${version}" =~ ^v ]]; then