settime.sh 632 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. CONF="/etc/speaker.conf"
  3. reboot="$1"
  4. action="$2"
  5. if [ "foo${reboot}" = "footrue" ];then
  6. if [ "foo${action}" = "fooset_ntp" ];then
  7. /etc/scripts/shell_action.sh showReboot
  8. sleep 1
  9. /sbin/reboot
  10. fi
  11. fi
  12. /etc/init.d/S49ntp stop
  13. case ${action} in
  14. set_ntp)
  15. /etc/init.d/S49ntp start
  16. ;;
  17. set_manual)
  18. if [ ! -z "$3" ];then
  19. manual_time="$3"
  20. /bin/date -s "${manual_time}" && /sbin/hwclock -w -u
  21. fi
  22. ;;
  23. esac
  24. /usr/bin/killall clock.sh > /dev/null 2>&1
  25. /etc/scripts/clock.sh > /dev/null 2>&1 &
  26. if [ "foo${reboot}" = "footrue" ];then
  27. /etc/scripts/shell_action.sh showReboot
  28. sleep 1
  29. /sbin/reboot
  30. fi
  31. exit 0