
RTCmode=-u  #RTC keeps time in:  -u for UTC, -l for local time

[ -f /proc/driver/rtc ] || {
  echo "No Real-Time clock available."
  exit 1
}

case "$1" in
    start)
      echo -n "Set system clock to:  "
      /sbin/hwclock -s $RTCmode
      date
       ;;
                         
    stop)
      echo -n "Set Real-Time clock to:  "
      date
      /sbin/hwclock -w $RTCmode
       ;;
       
    *)
       echo "usage: start|stop"
       echo "on start:  set the system clock from the hardware clock"
       echo "on stop:   set the hardware clock from the system clock"
       ;;
esac
