Skip to content

Instantly share code, notes, and snippets.

@deyvisonrocha
Last active April 23, 2020 12:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save deyvisonrocha/1246c8b8bc5fc28257734e5565d314f9 to your computer and use it in GitHub Desktop.
Script to install Official Telegram Desktop
#!/bin/bash
MACHINE_TYPE=`uname -m`
# Removing old versions
echo 'Removing old versions'
sudo rm -Rf /opt/telegram*
sudo rm -Rf /usr/bin/telegram
sudo rm -Rf /usr/share/applications/telegram.desktop
echo 'Identify Machine Type'
# Identify Machine Type
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
wget "https://telegram.org/dl/desktop/linux" -O /tmp/telegram.tar.xz
else
wget "https://telegram.org/dl/desktop/linux32" -O /tmp/telegram.tar.xz
fi
# Extract the files
echo 'Extracting the files'
sudo tar Jxf /tmp/telegram.tar.xz -C /opt/
sudo mv /opt/Telegram*/ /opt/telegram
# Create a shortcut on system
echo 'Creating symbol link'
sudo ln -sf /opt/telegram/Telegram /usr/bin/telegram
echo 'Installation finish'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment