mirror of
https://github.com/ThunixdotNet/thunixctl.git
synced 2026-01-23 20:40:17 +00:00
Adding system upgrade
This commit is contained in:
40
thunixctl
40
thunixctl
@@ -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 $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
|
case $NOUN in
|
||||||
ansible)
|
ansible)
|
||||||
echo ansible
|
|
||||||
ansible
|
ansible
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
www|gopher)
|
www|gopher)
|
||||||
echo www
|
|
||||||
www
|
www
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
manpages)
|
||||||
|
manpages
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
update)
|
||||||
|
aptupgrade
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo fail
|
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user