From 3b538627379d9283715e6f32067582232363dfdb Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 14 Sep 2021 22:47:39 +0200 Subject: [PATCH] Update updater script --- conf/ldap.src.default | 7 +++++++ scripts/update_version.sh | 18 +++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 conf/ldap.src.default diff --git a/conf/ldap.src.default b/conf/ldap.src.default new file mode 100644 index 0000000..ed6b326 --- /dev/null +++ b/conf/ldap.src.default @@ -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 diff --git a/scripts/update_version.sh b/scripts/update_version.sh index a4f2c7c..cc07c74 100755 --- a/scripts/update_version.sh +++ b/scripts/update_version.sh @@ -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"