Advertisement
TheDiscordian

setup-ubuntu.sh

Aug 16th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.75 KB | None | 0 0
  1. #!/bin/bash
  2. echo "Simple Ubuntu Updater v1.0.1 (14.04 -> 18.04) (Use at your own risk)"
  3. rel=`lsb_release -r`
  4. if [[ $rel = *"18.04" ]]; then
  5.   echo "Already on 18.04!"
  6.   exit
  7. fi
  8.  
  9. if [ `whoami` != "root" ]; then
  10.   echo "Script must be run as root."
  11.   exit
  12. fi
  13.  
  14. if [ ! -f /root/setup-ubuntu.sh ]; then
  15.   echo "The 'setup-ubuntu.sh' script must be placed in '/root/setup-ubuntu.sh'!"
  16.   exit
  17. fi
  18.  
  19. if [[ $rel = *"16.04" ]]; then
  20.   echo
  21.   echo "Upgrading 16.04 -> 18.04..."
  22.   echo
  23.   sleep 3
  24.   sed -i '$d' .bashrc
  25.   do-release-upgrade -dm server
  26.   exit
  27. fi
  28.  
  29. if [[ $rel = *"14.04" ]]; then
  30.   echo
  31.   echo "Upgrading 14.04 -> 16.04..."
  32.   echo
  33.   sleep 3
  34.   echo "/root/setup-ubuntu.sh" >> /root/.bashrc
  35.   do-release-upgrade -pm server
  36.   exit
  37. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement