v_restart_web 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. # info: restart dns service
  3. # options: none
  4. #
  5. # The function tells BIND service to reload dns zone files.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Importing variables
  10. source $VESTA/conf/vars.conf
  11. source $V_CONF/vesta.conf
  12. # Restart functions
  13. apache() {
  14. /etc/init.d/httpd 'graceful' >/dev/null 2>&1
  15. if [ $? -ne 0 ]; then
  16. #$V_FUNC/report_issue 'web' 'apache'
  17. echo "$E_RESTART_FAILED $V_EVENT"
  18. fi
  19. }
  20. nginx() {
  21. /etc/init.d/nginx 'reload' >/dev/null 2>&1
  22. if [ $? -ne 0 ]; then
  23. #$V_FUNC/report_issue 'web' 'nginx'
  24. echo "$E_RESTART_FAILED $V_EVENT"
  25. fi
  26. }
  27. #----------------------------------------------------------#
  28. # Action #
  29. #----------------------------------------------------------#
  30. # Checking system
  31. if [ "$WEB_SYSTEM" = 'apache' ]; then
  32. apache
  33. fi
  34. if [ "$PROXY_SYSTEM" = 'nginx' ]; then
  35. nginx
  36. fi
  37. #----------------------------------------------------------#
  38. # Vesta #
  39. #----------------------------------------------------------#
  40. # Logging
  41. exit