Fix update checker
This commit is contained in:
parent
82f6a9fe77
commit
841f177a79
2 changed files with 7 additions and 2 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
|
1.4.5-1
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,12 @@ VERSION=`cat VERSION`
|
||||||
|
|
||||||
JSON_CONTENT=$(curl -q https://protonmail.com/download/current_version_linux.json)
|
JSON_CONTENT=$(curl -q https://protonmail.com/download/current_version_linux.json)
|
||||||
URL=$(echo ${JSON_CONTENT} | sed -n "s/^.*\"DebFile\":\"\([a-z0-9:/._-]*\)\".*$/\1/p")
|
URL=$(echo ${JSON_CONTENT} | sed -n "s/^.*\"DebFile\":\"\([a-z0-9:/._-]*\)\".*$/\1/p")
|
||||||
CURR_VERSION=$(echo $URL | sed -n "s/https:\/\/protonmail.com\/download\/protonmail-bridge_\([0-9.-]*\)_amd64.deb/\1/p")
|
CURR_VERSION=$(echo $URL | sed -n "s/https:\/\/protonmail.com\/.*_\([0-9.-]*\)_.*.deb/\1/p")
|
||||||
|
|
||||||
|
if [[ -z $CURR_VERSION ]]; then
|
||||||
|
echo "Failed to get new version. Existing."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $VERSION != $CURR_VERSION ]]; then
|
if [[ $VERSION != $CURR_VERSION ]]; then
|
||||||
echo "New release found: ${CURR_VERSION}"
|
echo "New release found: ${CURR_VERSION}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue