#!/bin/sh
#
# Run ADJTIMEX at startup.

### BEGIN INIT INFO
# Provides:          adjtimex
# Required-Start:    $local_fs
# Required-Stop:     
# Should-Start:      
# Should-Stop:       
# Default-Start:     S
# Default-Stop:
# Short-Description: set the kernel time variables
# Description:       set the kernel time variables
### END INIT INFO

. /lib/lsb/init-functions

test -x /sbin/adjtimex  || exit 0

# default values
TICK=10000
FREQ=0
 
# values in $cfg take precedence over the values here
cfg=/etc/default/adjtimex

if [ -f $cfg ]; then
  . $cfg
fi

case "$1" in
  start|restart|force-reload)
    echo -n "Regulating system clock..."
    /sbin/adjtimex -tick "$TICK" -frequency "$FREQ"
    echo "done."
    ;;
  stop|status)
    ;;
  *)
    echo "/etc/init.d/adjtimex: unknown command $1" >&2
    echo "Usage: /etc/init.d/adjtimex {start|stop|restart|force-reload}" >&2
    exit 3
    ;;
esac

exit 0
