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

Last change on this file since 5768 was 5768, checked in by kbut, 2 years ago

rename lliurex-telegram.sh to telegram

File size: 2.0 KB
Line 
1#!/bin/bash
2#set -x
3PACKAGE_NAME="Telegram"
4
5#Get last version
6TCH_URL="https://desktop.telegram.org/changelog"
7TVERSION=$(wget -qO- $TCH_URL | sed -e 's/<[^>]*>//g;/^\s*$/d' | grep -o 'v [0-9.]*' -m1 | cut -d ' ' -f2)
8
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        USERHOME=$(getent passwd $USER | cut -f6 -d ':')
26        BINDIR=$USERHOME"/.local/bin"
27        DESTDIR=$BINDIR"/telegram"
28        mkdir -p $DESTDIR
29        zero-lliurex-wget ${TURL}${TSETUP} ${DESTDIR}
30        if [ -s ${DESTDIR}"/"${TSETUP} ]
31        then
32                FIRSTPWD=$PWD
33                cd $DESTDIR
34                tar -Jxf $TSETUP
35                chown -R ${USER}:${USER} $BINDIR
36                if [ $? -eq 0 ]
37                then
38                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   
39                        zero-center set-configured zero-lliurex-telegram
40                else
41                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   
42                        rm -r $DESTDIR
43                fi
44                cd $FIRSTPWD
45                su $USER -c /usr/bin/telegram
46        else
47                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   
48                rm -fr $DESTDIR
49        fi
50fi
51zero-center remove-pulsating-color lliurex-zero-installer-telegram
52exit 0
Note: See TracBrowser for help on using the repository browser.