v_restart_web 663 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # Internal vesta function
  3. # web system restart
  4. # Importing variables
  5. source $VESTA/conf/vars.conf
  6. source $V_CONF/vesta.conf
  7. # Restart functions
  8. apache() {
  9. /etc/init.d/httpd 'graceful' >/dev/null 2>&1
  10. if [ $? -ne 0 ]; then
  11. #$V_FUNC/report_issue 'web' 'apache'
  12. echo "$E_RESTART_FAILED $V_EVENT"
  13. fi
  14. }
  15. nginx() {
  16. /etc/init.d/nginx 'reload' >/dev/null 2>&1
  17. if [ $? -ne 0 ]; then
  18. #$V_FUNC/report_issue 'web' 'nginx'
  19. echo "$E_RESTART_FAILED $V_EVENT"
  20. fi
  21. }
  22. # Checking system
  23. if [ "$WEB_SYSTEM" = 'apache' ]; then
  24. apache
  25. fi
  26. if [ "$PROXY_SYSTEM" = 'nginx' ]; then
  27. nginx
  28. fi
  29. # Logging
  30. exit $OK