source: zero-lliurex-installers/trunk/fuentes/zero-lliurex-telegram.zmds/zero-lliurex-telegram.zmd @ 5654

Last change on this file since 5654 was 5654, checked in by Juanma, 2 years ago

Updated telegram installer

File size: 2.1 KB
Line 
1#!/bin/bash
2#set -x
3
4#Get last version
5TVERSION=$(wget -qO- https://desktop.telegram.org/changelog | sed -e 's/<[^>]*>//g;/^\s*$/d' | grep -o 'v [0-9.]*' -m1 | cut -d ' ' -f2)
6
7#TVERSION=1.0.14
8PACKAGE_NAME="Telegram"
9if [[ `arch` == "x86_64" ]]
10then
11        TSETUP="tsetup."$TVERSION".tar.xz"
12        TURL="https://updates.tdesktop.com/tlinux/"
13else
14        TSETUP="tsetup32."$TVERSION".tar.xz"
15        TURL="https://updates.tdesktop.com/tlinux32/"
16fi
17
18#zero-center add-pulsating-color lliurex-zero-installer-telegram
19
20export TEXTDOMAIN="lliurex-zero-installer-telegram"
21zenity --question --title="Telegram" --text="$(gettext "Welcome to telegram installer for Llurex\nThis will install Telegram on your computer. Continue?\n")"
22
23if [ $? -eq 0 ]
24then
25        echo "Downloading telegram..."
26        USERHOME=$(getent passwd $USER | cut -f6 -d ':')
27        echo $USER
28        echo $USERHOME
29        BINDIR=$USERHOME"/.local/bin"
30        DESTDIR=$BINDIR"/telegram"
31        mkdir -p $DESTDIR
32        zero-lliurex-wget $TURL$TSETUP $DESTDIR
33        if [ -s ${DESTDIR}"/"${TSETUP} ]
34        then
35                FIRSTPWD=$PWD
36                cd $DESTDIR
37                tar -Jxvf $TSETUP
38                chown -vR $USER:$USER $BINDIR
39                if [ $? -eq 0 ]
40                then
41                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   
42                        zero-center set-configured zero-lliurex-telegram
43                else
44                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   
45                        rm -r $DESTDIR
46                fi
47                cd $FIRSTPWD
48                su $USER -c /usr/bin/lliurex-telegram.sh
49        else
50                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   
51                rm -fr $DESTDIR
52        fi
53fi
54zero-center remove-pulsating-color lliurex-zero-installer-telegram
55exit 0
Note: See TracBrowser for help on using the repository browser.