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-18 02:01:55 +02:00
parent f385b79539
commit 315efea4f1

View file

@ -19,7 +19,7 @@ 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_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)
version_ftl=$(curl --silent "https://api.github.com/repos/pi-hole/FTL/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_adminlte.tar.gz"
assets[2]="https://github.com/pi-hole/FTL/archive/$version_ftl.tar.gz"
@ -30,6 +30,12 @@ assets[2]="https://github.com/pi-hole/FTL/archive/$version_ftl.tar.gz"
if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then
version=${version:1}
fi
if [[ ${version_adminlte:0:1} == "v" || ${version_adminlte:0:1} == "V" ]]; then
version_adminlte=${version_adminlte:1}
fi
if [[ ${version_ftl:0:1} == "v" || ${version_ftl:0:1} == "V" ]]; then
version_ftl=${version_ftl:1}
fi
# Setting up the environment variables
echo "Current version: $current_version"
@ -128,6 +134,9 @@ done
# Any action on the app's source code can be done.
# The GitHub Action workflow takes care of committing all changes after this script ends.
sed -i "/pihole_adminlte_version/c\pihole_adminlte_version=$version_adminlte" scripts/_common.sh
sed -i "/pihole_flt_version/c\pihole_flt_version=$version_ftl" scripts/_common.sh
#=================================================
# GENERIC FINALIZATION
#=================================================