Last active
April 2, 2020 13:45
-
-
Save u1-liquid/dbdf2abf73631530555752226a4afd3a to your computer and use it in GitHub Desktop.
Unattended upgrade riot-web (Matrix.org Web Client) including pre-releases
This file contains 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 | |
pushd /home/matrix/riot > /dev/null | |
LATEST=$(curl -sSL https://api.github.com/repos/vector-im/riot-web/releases | grep "browser_download_url" | grep -o -E "https://github.com/(.+)\.\w+" | grep -E "\.tar\.gz$" | head -n 1) | |
curl -sSL -o latest $LATEST.asc && diff current latest | |
if [[ $? -eq 0 ]]; then | |
rm latest | |
else | |
curl -sSL -o riot.tar.gz $LATEST | |
if [[ $? -eq 0 ]]; then | |
mv -f latest current | |
tar xvzf riot.tar.gz | |
rm -rf live riot.tar.gz | |
mv riot-* live | |
ln -s /home/matrix/riot/config.json live/config.json | |
/home/matrix/note 【告知】Riot Web クライアントが v$(cat live/version) にアップグレードされました。 | |
else | |
rm latest | |
fi | |
fi | |
popd > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment