mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
implemented scheduled restart
This commit is contained in:
parent
ca81632e82
commit
10f7097c48
46 changed files with 172 additions and 63 deletions
|
@ -18,6 +18,17 @@ source $VESTA/func/main.sh
|
|||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Schedule restart
|
||||
if [ "$1" = 'scheduled' ]; then
|
||||
echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe
|
||||
exit
|
||||
fi
|
||||
if [ -z "$1" ] && [ "$SCHEDULED_RESTART" = 'yes' ]; then
|
||||
echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe
|
||||
exit
|
||||
fi
|
||||
|
||||
# Restart system
|
||||
if [ ! -z "$WEB_SYSTEM" ]; then
|
||||
/etc/init.d/$WEB_SYSTEM reload >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
|
@ -28,6 +39,11 @@ if [ ! -z "$WEB_SYSTEM" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Update restart queue
|
||||
if [ -e "$VESTA/data/queue/restart.pipe" ]; then
|
||||
sed -i "/$SCRIPT/d" $VESTA/data/queue/restart.pipe
|
||||
fi
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue