Skip to content

Instantly share code, notes, and snippets.

@waltspence
Last active January 5, 2017 08:51
Show Gist options
  • Save waltspence/002880c0ecb9a122dff0b0fe989e81f6 to your computer and use it in GitHub Desktop.
Save waltspence/002880c0ecb9a122dff0b0fe989e81f6 to your computer and use it in GitHub Desktop.
Update Ubuntu Server Script
#!/bin/bash
# ---------------------------------------------------------------------
# [@WaltSpence of @MakeGoCo]
# Updater
# A simple command to update debian based linux [sudo update]
# This is licensed under the Unlicense as seen at this link
# http://unlicense.org/UNLICENSE
# ---------------------------------------------------------------------
NAME=Updater
VERSION=1.0
SUBJECT=WES-1116-005
USAGE="Update debian based linux systems with one simple command"
CHANGELOG="Created project"
# --- Options processing -------------------------------------------
# --- Start --------------------------------------------------------
echo "\nUpdating with apt-get\n"
apt-get update
apt-get upgrade -y
read -r -p "Do you want to perform a distro upgrade? Y/N " response
case $response in
[yY][eE][sS]|[yY])
apt-get dist-upgrade -y
apt-get autoclean
apt-get autoremove -y
;;
*)
apt-get autoclean
apt-get autoremove -y
;;
esac
echo "\nUpdate Complete!\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment