#!/bin/sh
#----------------------------------------------------------------------------
# /etc/ppp/ip-up500.chrony - allow chronyd access time servers
#                            if default route is going up
#
# Creation:     2004-06-06  abe
# Last Update:  $Id: ip-up500.chrony 10131 2005-10-29 13:19:26Z hh $
#----------------------------------------------------------------------------

case $is_default_route in
yes)
    chrony_conf="/etc/chrony.conf"
    if [ -f $chrony_conf ]
    then
        if [ -f $chrony_conf.first ]
        then
            kill `cat /var/run/chronyd.pid`
            mv $chrony_conf.first $chrony_conf
            chronyd -r
            started="true"
        fi
    fi
    {
    case $started in
        true) sleep 5 ;;
    esac
    /usr/bin/chronyc >/dev/null <<-EOF
	password dummy
	online
EOF
    }&
;;
esac
