-
-
Save wellic/f71855c574060b5d0743b2b4a06cf2d2 to your computer and use it in GitHub Desktop.
telegram-installer.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 "Change ownership to root" | |
sudo chown -R root:root /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