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

Last change on this file since 3795 was 3795, checked in by Juanma, 3 years ago

Fix permissions

File size: 1.8 KB
Line 
1#!/bin/bash
2#set -x
3
4TVERSION=1.0.14
5PACKAGE_NAME="Telegram"
6if [[ `arch` == "x86_64" ]]
7then
8        TSETUP="tsetup."$TVERSION".tar.xz"
9        TURL="https://updates.tdesktop.com/tlinux/"
10else
11        TSETUP="tsetup32."$TVERSION".tar.xz"
12        TURL="https://updates.tdesktop.com/tlinux32/"
13fi
14
15#zero-center add-pulsating-color lliurex-zero-installer-telegram
16
17export TEXTDOMAIN="lliurex-zero-installer-telegram"
18zenity --question --title="Telegram" --text="$(gettext "Welcome to telegram installer for Llurex\nThis will install Telegram on your computer. Continue?\n")"
19
20if [ $? -eq 0 ]
21then
22        echo "Downloading telegram..."
23        BINDIR="$HOME"/.local/bin""
24        DESTDIR=$BINDIR"/telegram"
25        mkdir -p $DESTDIR
26        zero-lliurex-wget $TURL$TSETUP $DESTDIR
27        if [ $? -eq 0 ]
28        then
29                FIRSTPWD=$PWD
30                cd $DESTDIR
31                tar -Jxvf $TSETUP
32                chown -vR $USER:$USER $BINDIR
33                su $USER -c ./Telegram/Telegram
34                if [ $? -eq 0 ]
35                then
36                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   
37                        zero-center set-configured lliurex-zero-installer-telegram
38                else
39                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   
40                        rm -r $DESTDIR
41                fi
42                cd $FIRSTPWD
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
47fi
48zero-center remove-pulsating-color lliurex-zero-installer-telegram
49exit 0
Note: See TracBrowser for help on using the repository browser.