#! /bin/bash
#
# hwclock		Sets "hardware" clock
#
# description: 		On a suspend we set the "hardware" clock. We also
#			do it on a resume just in case. The clock is only
#			ever restored from this value on a reboot.
#



# See how we were called.
  
suspend() {
  hwclock --systohc
  return 0
}

resume() {
  hwclock --hctosys
  return 0
}	


case "$1" in
  suspend)
  	suspend
	;;
  resume)
  	resume
	;;
  *)
	echo "Usage: $0 {suspend|resume}"
	exit 1
esac

exit $?
