Skip to content

Instantly share code, notes, and snippets.

Embed
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="$HOME/.apps/telegram"
echo "Checking apps folder..."
appsfolder="$HOME/.apps"
if [ ! -d $appsfolder ]; then
mkdir $HOME/.apps
echo "Created ${appsfolder}"
elif [ -d $installdir ]; then
rm -r $installdir
echo "Removed old ${installdir}"
else
echo "${installdir} is not exists...moving on"
fi
mv Telegram $installdir
echo "Moved new files to ${installdir}"
echo "Checking duplicating shortcut files"
telegramdesktop="$HOME/.local/share/applications/telegramdesktop.desktop"
if [ -f $telegramdesktop ]; then
sudo rm $telegramdesktop
echo "Removed old shortcut: ${telegramdesktop}"
else
echo "${telegramdesktop} is not exists...moving on"
fi
echo "Checking old config"
old_data="$HOME/.local/share/TelegramDesktop"
if [ -d ${old_data} ]; then
sudo rm -r ${old_data}
echo "Removed old config data: ${old_data}"
else
echo "${old_data} is not exists...moving on"
fi
rm /tmp/tsetup.tar.xz
echo "Removed tmp files..."
echo "Checking old Telegram installation in /opt and removing it"
old_installdir="/opt/telegram"
if [ -d $old_installdir ];then
sudo rm -r $old_installdir
echo "Removed old installation ${old_installdir}"
else
echo "${old_installdir} is not exists...moving on"
fi
echo "Installation Complete! Launching Telegram for initial configuration"
$installdir/Updater > /dev/null 2>&1 &
@jumper423

This comment has been minimized.

Copy link

jumper423 commented Jun 28, 2018

wget -O - https://github.com/telegramdesktop/tdesktop/releases/download/v1.3.8/tsetup.1.3.8.tar.xz > tsetup.tar.xz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.