Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "Simple Ubuntu Updater v1.0.1 (14.04 -> 18.04) (Use at your own risk)"
- rel=`lsb_release -r`
- if [[ $rel = *"18.04" ]]; then
- echo "Already on 18.04!"
- exit
- fi
- if [ `whoami` != "root" ]; then
- echo "Script must be run as root."
- exit
- fi
- if [ ! -f /root/setup-ubuntu.sh ]; then
- echo "The 'setup-ubuntu.sh' script must be placed in '/root/setup-ubuntu.sh'!"
- exit
- fi
- if [[ $rel = *"16.04" ]]; then
- echo
- echo "Upgrading 16.04 -> 18.04..."
- echo
- sleep 3
- sed -i '$d' .bashrc
- do-release-upgrade -dm server
- exit
- fi
- if [[ $rel = *"14.04" ]]; then
- echo
- echo "Upgrading 14.04 -> 16.04..."
- echo
- sleep 3
- echo "/root/setup-ubuntu.sh" >> /root/.bashrc
- do-release-upgrade -pm server
- exit
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement