Files
VestaCP/bin/v_restart_web
2011-11-21 15:37:23 +02:00

37 lines
663 B
Bash
Executable File

#!/bin/bash
# Internal vesta function
# web system restart
# Importing variables
source $VESTA/conf/vars.conf
source $V_CONF/vesta.conf
# Restart functions
apache() {
/etc/init.d/httpd 'graceful' >/dev/null 2>&1
if [ $? -ne 0 ]; then
#$V_FUNC/report_issue 'web' 'apache'
echo "$E_RESTART_FAILED $V_EVENT"
fi
}
nginx() {
/etc/init.d/nginx 'reload' >/dev/null 2>&1
if [ $? -ne 0 ]; then
#$V_FUNC/report_issue 'web' 'nginx'
echo "$E_RESTART_FAILED $V_EVENT"
fi
}
# Checking system
if [ "$WEB_SYSTEM" = 'apache' ]; then
apache
fi
if [ "$PROXY_SYSTEM" = 'nginx' ]; then
nginx
fi
# Logging
exit $OK