add README, update code

This commit is contained in:
NunoSempere 2024-04-30 09:16:41 +02:00
parent cde1c165bb
commit 8cbb290090
2 changed files with 42 additions and 2 deletions

40 Normal file
View File

@ -0,0 +1,40 @@
# A function to update discord on Debian
Updating discord is annoying. Initially, this script automated the process. Now, it also checks headers, so that it can be added to a crontab or similar, and it only downloads the ~100 Mb discord file if it is indeed new.
## Usage
**Download and execute**
$ curl -o
$ cat
$ bash
**Add to .bashrc**
You might also want to add the contents of to your `.bashrc` file or similar.
**Usage in cron**
I think this is how you would add this to a crontab:
$ sudo crontab -e
# Then, inside the crontab
8 * * * * bash /download_path/
However, I haven't tested this yet with a new update
## Stack
- curl
- apt—implying Debian or derivatives
- bash
## Security posture
Total disregard. If you automatically download discord updates, if they are compromised you would have no warning.

View File

@ -1,8 +1,8 @@
function update_discord(){
mkdir -p "$HOME/Downloads/discord-update"
cd "$HOME/Downloads/discord-update"
mkdir -p "$HOME/Downloads/update-discord"
cd "$HOME/Downloads/update-discord"
curl -L -I "" -o discord.head
uri_old="$(cat discord.head.old | grep location | sed 's/location: //' )"