Skip to content

Instantly share code, notes, and snippets.

@mdmmn378
Created September 19, 2024 04:19
Show Gist options
  • Save mdmmn378/bb0068fedca03d36bdc66597c6e0ab52 to your computer and use it in GitHub Desktop.
Save mdmmn378/bb0068fedca03d36bdc66597c6e0ab52 to your computer and use it in GitHub Desktop.
Discord Auto Updater
  1. Run > sudo crontab -e
  2. Append > 0 0 */2 * * /home/mamun/bin/install_discord.sh
#!/bin/bash
# Set the temporary directory and filename
DOWNLOAD_DIR=$(mktemp -d)
FILENAME="discord.deb"
# Ensure the directory exists
mkdir -p "$DOWNLOAD_DIR"
# Download the latest Discord release
aria2c --dir="$DOWNLOAD_DIR" --out="$FILENAME" "https://discord.com/api/download/stable?platform=linux"
# Install the downloaded .deb file using gdebi
sudo gdebi -n "$DOWNLOAD_DIR/$FILENAME"
# Remove the downloaded file
rm -f "$DOWNLOAD_DIR/$FILENAME"
echo "Discord has been installed and the temporary file has been deleted."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment