1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pihole_ynh.git synced 2024-09-03 20:05:58 +02:00

Update updater.sh

This commit is contained in:
yalh76 2022-09-17 19:07:34 +02:00
parent 0819d938bf
commit bb351ff8e0

View file

@ -18,9 +18,11 @@ current_version=$(cat manifest.json | jq -j '.version|split("~")[0]')
repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]')
# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions)
version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1)
version_dashboard=$(curl --silent "https://api.github.com/repos/pi-hole/AdminLTE/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1)
version_adminlte=$(curl --silent "https://api.github.com/repos/pi-hole/AdminLTE/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1)
version_ftl=$(curl --silent "https://api.github.com/repos/pi-hole/AdminLTE/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1)
assets[0]="https://github.com/pi-hole/pi-hole/archive/$version.tar.gz"
assets[1]="https://github.com/pi-hole/AdminLTE/archive/$version_dashboard.tar.gz"
assets[1]="https://github.com/pi-hole/AdminLTE/archive/$version_adminlte.tar.gz"
assets[2]="https://github.com/pi-hole/FTL/archive/$version_ftl.tar.gz"
# Later down the script, we assume the version has only digits and dots
# Sometimes the release name starts with a "v", so let's filter it out.
@ -66,6 +68,9 @@ for asset_url in ${assets[@]}; do
# Here we base the source file name upon a unique keyword in the assets url (admin vs. update)
# Leave $src empty to ignore the asset
case $asset_url in
*"FTL"*)
src="pi-hole_FTL"
;;
*"AdminLTE"*)
src="pi-hole_AdminLTE"
;;