v-restart-cron 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # info: restart cron service
  3. # options: none
  4. #
  5. # The function tells crond service to reread its 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. # Parsing config / or just source config
  17. if [ "$CRON_SYSTEM" = 'crond' ]; then
  18. /etc/init.d/crond 'reload' &>/dev/null
  19. if [ $? -ne 0 ]; then
  20. /etc/init.d/crond 'restart' &>/dev/null
  21. if [ $? -ne 0 ]; then
  22. log_event "$E_RESTART" "$EVENT"
  23. exit $E_RESTART
  24. fi
  25. fi
  26. fi
  27. #----------------------------------------------------------#
  28. # Vesta #
  29. #----------------------------------------------------------#
  30. exit