SevenChalices

Auto update Discord-Canary on Debian

Jul 25th, 2023 (edited)
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.14 KB | Source Code | 0 0
  1. #!/bin/sh
  2. #########################################################################################################
  3. ## Script to update Discord automatically instead of waiting for updates at each start                 ##
  4. ##                                                                                                     ##
  5. ## Original author: BillyGalbreath                                                                     ##
  6. ## https://support.discord.com/hc/en-us/community/posts/360031737491-Give-us-an-apt-repository-Linux-  ##
  7. #########################################################################################################
  8.  
  9. ### ensure script is run as root/sudo
  10. if ! [ $(id -u) = 0 ]; then
  11.     if [ "$1" ]; then
  12.         echo "Error: root privileges required"
  13.         exit 1
  14.     fi
  15.     sudo sh $0 "1"
  16.     exit $?
  17. fi
  18.  
  19. ### download and install as root
  20. wget -O /tmp/discord-installer.deb "https://discordapp.com/api/download/canary?platform=linux&format=deb"
  21. dpkg -i /tmp/discord-installer.deb
  22.  
  23. ### execute discord as real user that invoked script
  24. sudo -u `[ $SUDO_USER ] && echo $SUDO_USER || echo $(whoami)` discord-canary
Advertisement
Add Comment
Please, Sign In to add comment