- Run >
sudo crontab -e
- Append >
0 0 */2 * * /home/mamun/bin/install_discord.sh
Created
September 19, 2024 04:19
-
-
Save mdmmn378/bb0068fedca03d36bdc66597c6e0ab52 to your computer and use it in GitHub Desktop.
Discord Auto Updater
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 | |
# 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