1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 00:08:51 -05:00

<target name="delta" description="Upload incremental update archive">

This commit is contained in:
Reinhard Pointner 2018-06-26 19:28:29 +07:00
parent 4c9537d1e0
commit 1a9cf63be8

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh -xu
PRG="$0"
# resolve relative symlinks
@ -18,18 +18,23 @@ FILEBOT_HOME=`cd "$PRG_DIR" && pwd`
# update core application files
PACKAGE_NAME="CHANGES.tar.xz.gpg"
PACKAGE_NAME="DELTA.tar.xz"
PACKAGE_FILE="$FILEBOT_HOME/$PACKAGE_NAME"
PACKAGE_URL="https://get.filebot.net/filebot/latest/$PACKAGE_NAME"
PACKAGE_URL="@{link.release.index}/HEAD/$PACKAGE_NAME"
SIGNATURE_FILE="$PACKAGE_FILE.asc"
SIGNATURE_URL="$PACKAGE_URL.asc"
# use *.asc file to check for updates
echo "Update $PACKAGE_FILE"
HTTP_CODE=`curl -L -o "$PACKAGE_FILE" -z "$PACKAGE_FILE" --retry 5 "$PACKAGE_URL" -w "%{http_code}"`
HTTP_CODE=`curl -L -o "$SIGNATURE_FILE" -z "$SIGNATURE_FILE" --retry 5 "$SIGNATURE_URL" -w "%{http_code}"`
if [ $HTTP_CODE -ne 200 ]; then
echo "$HTTP_CODE NO UPDATE"
exit 1
fi
curl -L -o "$PACKAGE_FILE" --retry 5 "$PACKAGE_URL"
# initialize gpg
GPG_HOME="$FILEBOT_HOME/data/.gpg"
@ -38,5 +43,7 @@ if [ ! -d "$GPG_HOME" ]; then
mkdir -p "$GPG_HOME" && chmod 700 "$GPG_HOME" && gpg --homedir "$GPG_HOME" --import "$FILEBOT_HOME/maintainer.pub"
fi
# verify signature and extract jar
gpg --batch --yes --homedir "$GPG_HOME" --trusted-key "4E402EBF7C3C6A71" --decrypt "$PACKAGE_FILE" | tar -xJvf "-"
# verify signature and extract tar
if gpg --batch --yes --homedir "$GPG_HOME" --trusted-key "B0976E51E5C047AD0FD051294E402EBF7C3C6A71" --verify "$SIGNATURE_FILE" "$PACKAGE_FILE"; then
tar -xJvf "$PACKAGE_FILE" && rm -v "$PACKAGE_FILE"
fi