Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.