Script de mise à jour de mon element-web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

if [ $# -ne 0 ]
echo "usage $(basename $0)"
exit 1
function get_latest_release() {
curl --silent "$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
version=$(get_latest_release vector-im/element-web)
echo "Debut de l installation de Element $version"
printf "Nettoyage et sauvegarde"
rm -rf element-v*
printf "."
rm -rf riot_old
printf "."
cp -Rp riot/ riot_old
printf ". OK!\n"
printf "Recuperation element.."
wget${version}/element-${version}.tar.gz 1>/dev/null 2>/dev/null
printf ". OK!\n"
if [ $ret -eq 0 ]
printf "Installation."
tar xzf element-${version}.tar.gz
printf "."
cp -Rp element-${version}/* riot/
printf "."
chown -R www-data:www-data riot
printf ". OK!\nInstallation finie.\n"
exit 0
echo "Recuperation impossible, arret"
exit 2