I know many of us prefer the CLI to do updates - better feedback. I had taken to building aliases for the commands to shorten the typing. The other day I thought "why not a little script to do this?" I am not a programmer but I gave it a go.
Feedback and enhancements desired:
I set the defaults based on my typical use of the script. Update, Dist-upgrade, Exit.
Thoughts?
Feedback and enhancements desired:
Code:
#! /bin/bash # functions function quit { echo "Quiting..." exit } function badinput { echo "Invalid responce, please try again." } function update { echo "Updating..." sudo apt-get update break } function upgrade { echo "Upgrading..." sudo apt-get upgrade break } function dupgrade { echo "Dist-Upgrading..." sudo apt-get dist-upgrade break } function aremove { echo "Auto-removing..." sudo apt-get autoremove } function clean { echo "Cleaning..." sudo apt-get clean } function aclean { echo "Auto-cleaning..." sudo apt-get autoclean } #do it while true; do read -p "Would you like to update your repos? [Y/n/q]: " uanswer case $uanswer in n|N*) echo "Skipping update..." break ;; q|Q*) quit ;; *) update ;; esac done while true; do read -p "Dist-upgrade, Upgrade, Skip or Quit? [D/u/s/q]: " danswer case $danswer in u|U*) upgrade ;; n|N*) echo "Skipping upgrade..." break ;; q|Q*) quit ;; *) dupgrade ;; esac done echo "Final stage: Clean up..." while true; do read -p "Autoremove, Clean, autocLean or Exit script? [a/c/l/E]: " canswer case $canswer in a|A*) aremove ;; c|C*) clean ;; l|L*) aclean ;; *) quit ;; esac done
Thoughts?
Comment