Update linupx-scripts.sh
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user