Skip to content

Instantly share code, notes, and snippets.

@Thibaut-Fontaine
Created October 31, 2023 17:10
Show Gist options
  • Save Thibaut-Fontaine/6231813c12ccff99ffade0cec1d1a3b5 to your computer and use it in GitHub Desktop.
Save Thibaut-Fontaine/6231813c12ccff99ffade0cec1d1a3b5 to your computer and use it in GitHub Desktop.
discord update script for linux, debian, ubuntu
#!/bin/bash
format="deb"
platform="linux"
while getopts ":f:p:h" opt; do
case $opt in
f) format="$OPTARG" ;;
p) platform="$OPTARG" ;;
h)
echo "Usage: ./script.sh [-f <format>] [-p <platform>] [-h]"
echo "Options:"
echo " -f <format> Specify the download format (default: deb)"
echo " -p <platform> Specify the platform (default: linux)"
echo " -h Display this help message"
exit 0
;;
\?) echo "Invalid option: -$OPTARG" >&2; exit 1 ;;
:) echo "Option -$OPTARG requires an argument." >&2; exit 1 ;;
esac
done
download_url="https://discord.com/api/download/stable?platform=$platform&format=$format"
output_file="discord.deb"
curl -L --output $output_file $download_url
sudo apt install ./$output_file
discord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment