Update linupx-scripts.sh
This commit is contained in:
@@ -134,6 +134,36 @@ UPDATE3() {
|
|||||||
fi
|
fi
|
||||||
exit 0
|
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() {
|
DISTUPGRADE() {
|
||||||
if type yum &>/dev/null; then
|
if type yum &>/dev/null; then
|
||||||
$APTFUNC upgrade
|
$APTFUNC upgrade
|
||||||
@@ -420,6 +450,7 @@ INSTALL_MENU() {
|
|||||||
if [ ${action-x} ]; then
|
if [ ${action-x} ]; then
|
||||||
case $1 in
|
case $1 in
|
||||||
update) UPDATE3;;
|
update) UPDATE3;;
|
||||||
|
up) UPDATE4;;
|
||||||
# *) echo "Thats an invaild option,";
|
# *) echo "Thats an invaild option,";
|
||||||
# exit 1;;
|
# exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user