v-restart-mail 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. # info: restart mail service
  3. # options: none
  4. #
  5. # The function tells Exim service to reload configuration files.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Includes
  10. source $VESTA/conf/vesta.conf
  11. source $VESTA/func/main.sh
  12. EVENT=${1-$EVENT}
  13. #----------------------------------------------------------#
  14. # Action #
  15. #----------------------------------------------------------#
  16. if [ "$MAIL_SYSTEM" = 'exim' ]; then
  17. /etc/init.d/exim reload &>/dev/null
  18. if [ $? -ne 0 ]; then
  19. /etc/init.d/exim restart &>/dev/null
  20. if [ $? -ne 0 ]; then
  21. log_event "$E_RESTART" "$EVENT"
  22. exit $E_RESTART
  23. fi
  24. fi
  25. fi
  26. #----------------------------------------------------------#
  27. # Vesta #
  28. #----------------------------------------------------------#
  29. exit