Skip to content

Instantly share code, notes, and snippets.

@y4my4my4m
Created February 14, 2023 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y4my4my4m/9bf14f603da01cdea6a6ee2fdd27069b to your computer and use it in GitHub Desktop.
Save y4my4my4m/9bf14f603da01cdea6a6ee2fdd27069b to your computer and use it in GitHub Desktop.
A quick script to install discord for Arch. Sometimes discord need you to install the udpate as a .tar.gz. This script allows you to auto-install it. Just call this script from where you've downloaded the discord-0.0.25.tar.gz file and call it like "sudo discord-install.sh 25"
#!/bin/sh
set -e
if [ -z "$1" ] || ! [ "$1" -eq "$1" ] 2>/dev/null; then
echo "Invalid or missing argument. Please provide a valid number."
exit 1
fi
if sudo rm -rf /opt/Discord; then
echo "Removed old Discord installation."
else
echo "Failed to remove old Discord installation. Aborting."
exit 1
fi
echo "Extracting new Discord installation (version $1)..."
tar xvfz "$(pwd)/discord-0.0.$1.tar.gz"
echo "Moving new Discord installation to /opt..."
sudo mv "$(pwd)/Discord" /opt
@y4my4my4m
Copy link
Author

Just use it like:

  1. Download discord
    discord-0.0.26.tar.gz
  2. Navigate where you downloaded it
    cd ~/Downloads
  3. Launch the script relative to where the .tar.gz file is. Add the version number as argument.
    ../discord-install.sh 26

If ever discord is beyond version -0.0.x simply edit the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment