Auto update Discord-Canary on Debian
BillyGalbreath Mar 21st, 2019 (edited) 350 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- ### ensure script is run as root/sudo
- if ! [ $(id -u) = 0 ]; then
- if [ "$1" ]; then
- echo "Error: root privileges required"
- exit 1
- sudo sh $0 "1"
- exit $?
- ### download and install as root
- wget -O /tmp/discord-installer.deb "https://discordapp.com/api/download/canary?platform=linux&format=deb"
- dpkg -i /tmp/discord-installer.deb
- ### execute discord as real user that invoked script
- sudo -u `[ $SUDO_USER ] && echo $SUDO_USER || echo $(whoami)` discord-canary
RAW Paste Data