Created
December 22, 2018 23:54
-
-
Save yenda/20891ad0d506c45f8af5b10fb26df57a to your computer and use it in GitHub Desktop.
status desktop script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl https://status-im.ams3.digitaloceanspaces.com/latest.json > $PWD/latest | |
LATEST=$(cat latest | awk 'match($0, "(https.*AppImage)", m) {print m[1]}') | |
if [ -a current ] | |
then | |
CURRENT=$(cat current) | |
echo "Current version is $CURRENT" | |
else | |
echo "No current known version" | |
fi | |
if [ "$CURRENT" != "$LATEST" ] | |
then | |
echo "Downloading newer version" | |
echo $LATEST > current | |
kill $(pgrep AppRun) | |
kill $(pgrep ubuntu-server) | |
sleep 5 | |
curl $LATEST > StatusIm.AppImage | |
chmod +x StatusIm.AppImage | |
fi | |
if [ -z "$(pgrep AppRun)" ] | |
then | |
echo "Starting app" | |
./StatusIm.AppImage | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment