Update linupx-scripts.sh
This commit is contained in:
@@ -92,12 +92,22 @@ UPDATE2() {
|
|||||||
read -n 1 -s -p "Press any key to continue"
|
read -n 1 -s -p "Press any key to continue"
|
||||||
}
|
}
|
||||||
UPDATE3() {
|
UPDATE3() {
|
||||||
|
restart_flag='';
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
source /etc/environment
|
source /etc/environment
|
||||||
bash /etc/skel/.profile
|
bash /etc/skel/.profile
|
||||||
mv -f /opt/runupdates.log.2 /opt/runupdates.log.3
|
|
||||||
mv -f /opt/runupdates.log.1 /opt/runupdates.log.2
|
while getopts 'abf:v' flag; do
|
||||||
mv -f /opt/runupdates.log /opt/runupdates.log.1
|
case "${flag}" in
|
||||||
|
r) restart_flag='true' ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$autorun_logging" = true ]; then
|
||||||
|
mv -f /opt/runupdates.log.2 /opt/runupdates.log.3
|
||||||
|
mv -f /opt/runupdates.log.1 /opt/runupdates.log.2
|
||||||
|
mv -f /opt/runupdates.log /opt/runupdates.log.1
|
||||||
|
fi
|
||||||
if type yum &>/dev/null; then
|
if type yum &>/dev/null; then
|
||||||
yum -y update >> /opt/runupdates.log
|
yum -y update >> /opt/runupdates.log
|
||||||
else
|
else
|
||||||
@@ -117,9 +127,11 @@ UPDATE3() {
|
|||||||
touch "${FOLDER}/lastrun"
|
touch "${FOLDER}/lastrun"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${Green}Updates have completed${Color_Off}"
|
echo -e "${Green}Updates have completed${Color_Off}"
|
||||||
echo -e "${BOrange}Rebooting now...${Color_Off}"
|
if [ "$autorun_restart_after" = true ] || [ "$restart_flag" = true ]; then
|
||||||
sleep 3
|
echo -e "${BOrange}Rebooting now...${Color_Off}"
|
||||||
/sbin/shutdown -r now
|
sleep 3
|
||||||
|
/sbin/shutdown -r now
|
||||||
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
DISTUPGRADE() {
|
DISTUPGRADE() {
|
||||||
|
|||||||
Reference in New Issue
Block a user