#! /bin/sh # # clock This script sets the linux time from an RTC, and updates the RTC at # exit # [ -c /dev/rtc ] || exit 0 case "$1" in start|"") # # Set the linux time to match the RTC # hwclock -s echo "System Clock set. Local time: `date`" ;; stop) # # Set the RTC to match the linnux time. # hwclock -w ;; *) echo "Usage: clock {start|stop}" >&2 exit 1 ;; esac