Adding system upgrade

This commit is contained in:
Ubergeek 2019-11-13 01:32:55 +00:00
parent 02484c4e85
commit a4f9b6b9ac
1 changed files with 37 additions and 3 deletions

View File

@ -20,6 +20,8 @@
NOUN=$1 NOUN=$1
VERB=$2 VERB=$2
###
# Functions
function usage() { function usage() {
cat << _EOF cat << _EOF
$0 {service} {action} $0 {service} {action}
@ -80,20 +82,52 @@ function www() {
return return
} }
function manpages () {
case $NOUN in case $VERB in
ansible) pull)
echo ansible echo "Refreshing system documentation..."
ansible CURDIR=`pwd`
exit 0 cd /usr/local/man/man8
;; git pull
www|gopher) cd $CURDIR
echo www ;;
www *)
exit 0 echo "That action was not recognized."
usage
exit 1
;;
esac
return
}
function aptupgrade() {
apt update
apt upgrade -y
return
}
###
# Begin main part
case $NOUN in
ansible)
ansible
exit 0
;;
www|gopher)
www
exit 0
;;
manpages)
manpages
exit 0
;;
update)
aptupgrade
exit 0
;; ;;
*) *)
echo fail
usage usage
exit 1 exit 1
;; ;;