1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jellyfin_ynh.git synced 2024-09-03 19:26:29 +02:00

Update updater script

This commit is contained in:
tituspijean 2021-09-14 22:47:39 +02:00
parent c03b62434c
commit 3b53862737
2 changed files with 18 additions and 7 deletions

7
conf/ldap.src.default Normal file
View file

@ -0,0 +1,7 @@
SOURCE_URL=https://repo.jellyfin.org/releases/plugin/ldap-authentication/ldap-authentication___LDAP_PKG_VERSION__.zip
SOURCE_SUM=none
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=
SOURCE_EXTRACT=true

View file

@ -45,10 +45,6 @@ prepare_source () {
# Create the temporary directory
tempdir="$(mktemp -d)"
official_checksum_url=$(grep "SOURCE_SUM=" "$destination" | cut -d "=" -f 2)
official_checksum=$(curl -L -s "${official_checksum_url}" | cut -d ' ' -f 1)
echo $official_checksum
url=$(grep "SOURCE_URL=" "$destination" | cut -d "=" -f 2)
echo $url
filename=${url##*/}
@ -58,7 +54,13 @@ prepare_source () {
ynh_secure_remove $tempdir
if [[ "$official_checksum" != "$checksum" ]]; then
official_checksum_url=$(grep "SOURCE_SUM=" "$destination" | cut -d "=" -f 2)
if [[ "$official_checksum_url" != "none" ]]; then
official_checksum=$(curl -L -s "${official_checksum_url}" | cut -d ' ' -f 1)
echo $official_checksum
fi
if [[ "$official_checksum_url" != "none" && "$official_checksum" != "$checksum" ]]; then
echo "Downloaded file checksum ($checksum) does not match official checksum ($official_checksum)"
exit 1
else
@ -74,7 +76,9 @@ for architecture in "${architectures[@]}"; do
prepare_source --template="../conf/server.src.default" --destination="../conf/server.$architecture.src" --architecture="$architecture"
done
prepare_source --template="../conf/ldap.src.default" --destination="../conf/ldap.src"
sed -i "s# \"version\": \".*# \"version\": \"${version}\~ynh1\",#" ../manifest.json
git add .
git commit _common.sh ../manifest.json ../conf/ffmpeg.*.src ../conf/web.*.src ../conf/server.*.src -m "Upgrade to v$version"
git add _common.sh ../manifest.json ../conf/ffmpeg.*.src ../conf/web.*.src ../conf/server.*.src ../conf/ldap.src
git commit -m "Upgrade to v$version"