Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # A very simple script to Check for a new Discord version (Debian)
- # Twitter: @Kerbo_
- URL='https://discord.com/api/download/stable?platform=linux&format=deb'
- DEB='discord.deb'
- echo "Downloading deb"
- curl -L -s --output $DEB "$URL"
- DLVER=$(dpkg-deb -I $DEB | awk '/Version:/ {print $2}')
- VER=$(dpkg -l discord | awk '/^ii discord/ {print $3}')
- if [[ -z "$DLVER" || -z "$VER" ]]; then
- echo "Error determining version"
- exit 1
- fi
- echo " Installed version: $VER"
- echo "Downloaded version: $DLVER"
- if [[ "$VER" == "$DLVER" ]]; then
- echo "No action required"
- else
- echo "Stopping Discord"
- pkill Discord
- sleep 2
- echo Installing $DEB $DLVER
- sudo dpkg -i $DEB
- fi
- /bin/rm -f "$DEB"
- if [[ $(pgrep Discord | wc -l) -eq 0 ]]; then
- echo "Launching Discord"
- discord >/dev/null 2>&1 &
- fi
Advertisement
Add Comment
Please, Sign In to add comment