From a4f9b6b9acb472975ec22a75e4ae2455c4509c81 Mon Sep 17 00:00:00 2001 From: Ubergeek Date: Wed, 13 Nov 2019 01:32:55 +0000 Subject: [PATCH] Adding system upgrade --- thunixctl | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/thunixctl b/thunixctl index 5a5269c..be9b364 100755 --- a/thunixctl +++ b/thunixctl @@ -20,6 +20,8 @@ NOUN=$1 VERB=$2 +### +# Functions function usage() { cat << _EOF $0 {service} {action} @@ -80,20 +82,52 @@ function www() { return } +function manpages () { + + case $VERB in + pull) + echo "Refreshing system documentation..." + CURDIR=`pwd` + cd /usr/local/man/man8 + git pull + cd $CURDIR + ;; + *) + 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) - echo ansible ansible exit 0 ;; www|gopher) - echo www www exit 0 ;; + manpages) + manpages + exit 0 + ;; + update) + aptupgrade + exit 0 + ;; *) - echo fail usage exit 1 ;;