From 952eb2b408f854e7548dbd21bc8ed785b573aeb9 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 5 Dec 2018 09:34:50 -0600 Subject: [PATCH] Update linupx-scripts.sh --- linupx-scripts.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/linupx-scripts.sh b/linupx-scripts.sh index ee51487..ca90e01 100755 --- a/linupx-scripts.sh +++ b/linupx-scripts.sh @@ -134,6 +134,36 @@ UPDATE3() { fi exit 0 } + +UPDATE4() { + restart_flag=''; + + while getopts 'r' flag; do + case "${flag}" in + r) restart_flag='true' ;; + esac + done + + if type yum &>/dev/null; then + yum -y update + else + if [ "$useAutoremove" -ne 0 ]; then + apt-get -y autoremove + apt-get update + apt-get upgrade -y + apt-get -y autoremove + fi + fi + touch "${FOLDER}/lastrun" + echo "" + echo -e "${Green}Updates have completed${Color_Off}" + if [ "$autorun_restart_after" = true ] || [ "$restart_flag" = true ]; then + echo -e "${BOrange}Rebooting now...${Color_Off}" + sleep 3 + /sbin/shutdown -r now + fi + exit 0 +} DISTUPGRADE() { if type yum &>/dev/null; then $APTFUNC upgrade @@ -420,6 +450,7 @@ INSTALL_MENU() { if [ ${action-x} ]; then case $1 in update) UPDATE3;; + up) UPDATE4;; # *) echo "Thats an invaild option,"; # exit 1;; esac