Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
telegram-installer.sh
#!/bin/bash
echo "============================================="
echo "== Telegram Script Installer =="
echo "== =="
echo "== for www.LinuxRussia.com =="
echo "============================================="
echo "Downloading necesary files..."
cd /tmp
wget -O - https://tdesktop.com/linux > tsetup.tar.xz
echo "Extracting files..."
tar -xJvf tsetup.tar.xz
echo "Checking destination folder..."
installdir="/opt/telegram"
if [ -d ${installdir} ];then
sudo rm -r ${installdir}
else
echo "${installdir} is not exists...moving on"
fi
echo "Moving new files..."
sudo mv Telegram /opt/telegram
echo "Remove duplicating shortcut file if exists"
telegramdesktop="$HOME/.local/share/applications/telegramdesktop.desktop"
if [ -f ${telegramdesktop} ];then
sudo rm ${telegramdesktop}
else
echo "${telegramdesktop} is not exists...moving on"
fi
echo "Remove older config"
older_data="$HOME/.local/share/TelegramDesktop"
if [ -d ${older_data} ];then
sudo rm -r ${older_data}
else
echo "${older_data} is not exists...moving on"
fi
echo "Removing old files...."
rm /tmp/tsetup.tar.xz
echo "Installation Complete! Launching Telegram for initial configuration"
/opt/telegram/Updater > /dev/null 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment