Last active
September 11, 2025 15:35
-
-
Save SiKing/345e570054d463e1786e43f28934192a to your computer and use it in GitHub Desktop.
Discord on Linux does not (and **will** not) have a PPA. Drop this script in your /etc/cron.daily/ and forget about it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
echo "Are we superuser?" | |
[[ $EUID -eq 0 ]] | |
echo "OK" | |
# Make sure cleanup runs even if the script exits abnormally | |
trap "rm --force /tmp/discord.deb" EXIT | |
# Find latest package version | |
nextVersion=$( curl --head --silent --output /dev/null --write-out '%header{location}' https://discord.com/api/download?platform=linux | \ | |
awk -F '/' '{ print $(NF-1) }' ) | |
# Find intalled package version | |
instVersion=$( dpkg-query --showformat='${Version}' --show discord ) | |
if dpkg --compare-versions "$nextVersion" gt "$instVersion"; then | |
curl --get --location --silent --output /tmp/discord.deb https://discord.com/api/download?platform=linux | |
dpkg --install /tmp/discord.deb | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment