#!/bin/bash #set -x TVERSION=1.0.14 PACKAGE_NAME="Telegram" if [[ `arch` == "x86_64" ]] then TSETUP="tsetup."$TVERSION".tar.xz" TURL="https://updates.tdesktop.com/tlinux/" else TSETUP="tsetup32."$TVERSION".tar.xz" TURL="https://updates.tdesktop.com/tlinux32/" fi #zero-center add-pulsating-color lliurex-zero-installer-telegram export TEXTDOMAIN="lliurex-zero-installer-telegram" zenity --question --title="Telegram" --text="$(gettext "Welcome to telegram installer for Llurex\nThis will install Telegram on your computer. Continue?\n")" if [ $? -eq 0 ] then echo "Downloading telegram..." DESTDIR=$HOME"/.local/bin/telegram" mkdir -p $DESTDIR chown $USER $DESTDIR zero-lliurex-wget $TURL$TSETUP $DESTDIR if [ $? -eq 0 ] then FIRSTPWD=$PWD cd $DESTDIR tar -Jxvf $TSETUP su $USER -c ./Telegram/Telegram if [ $? -eq 0 ] then su -c "notify-send -t 2000 -u normal -i /usr/share/icons/lliurex-neu/scalable/apps/zero-center.svg 'Zero-Installer' 'Package $PACKAGE_NAME has been installed in your system,'" $USER zero-center set-configured lliurex-zero-installer-telegram else su -c "notify-send -t 2000 -u critical -i /usr/share/icons/lliurex-neu/scalable/apps/zero-center.svg 'Zero-Installer' 'Package $PACKAGE_NAME is not installed in your system, please retry again or contact with Lliurex Team at http://mestreacasa.gva.es/web/lliurex/forums'" $USER fi cd $FIRSTPWD else su -c "notify-send -t 2000 -u critical -i /usr/share/icons/lliurex-neu/scalable/apps/zero-center.svg 'Zero-Installer' 'Package $PACKAGE_NAME is not installed in your system, please retry again or contact with Lliurex Team at http://mestreacasa.gva.es/web/lliurex/forums'" $USER fi fi zero-center remove-pulsating-color lliurex-zero-installer-telegram exit 0