Skip to content

Instantly share code, notes, and snippets.

@yenda
Created December 22, 2018 23:54
Show Gist options
  • Save yenda/20891ad0d506c45f8af5b10fb26df57a to your computer and use it in GitHub Desktop.
Save yenda/20891ad0d506c45f8af5b10fb26df57a to your computer and use it in GitHub Desktop.
status desktop script
#!/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