Skip to content

Instantly share code, notes, and snippets.

@StudioLE
Last active April 3, 2016 10:07
Show Gist options
  • Select an option

  • Save StudioLE/cc5b1bbf4c82ec37a624 to your computer and use it in GitHub Desktop.

Select an option

Save StudioLE/cc5b1bbf4c82ec37a624 to your computer and use it in GitHub Desktop.
Shell Tools Suite
#!/bin/bash
echo "apt-get update & upgrade wizard"
echo "Would you like to assume yes? [y/n]"
read input_force
if [ $input_force = y ]
then
force="--yes"
fi
apt update
apt upgrade $force
echo "Run full-upgrade? [y/n]"
read full_upgrade
if [ $full_upgrade = n ]
then
echo "Aborted"
exit
fi
apt full-upgrade $force
if [ ! -f /var/run/reboot-required ]
then
echo "No reboot required"
exit
fi
echo "A reboot is required"
echo "Would you like to reboot now? [y/n]"
read reboot_now
if [ $reboot_now = y ]
then
echo "Rebooting"
reboot
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment