#!/bin/sh
# This script tells chronyd that the connection is down
# so that it won't try to contact the server. 
# John Hasler <jhasler@debian.org>  1998-2003
# Any possessor of a copy of this program may treat it as if it
# were in the public domain.  I waive all rights.
# Modified by Vincent Blut <vincent.debian@free.fr>

/bin/pidof chronyd > /dev/null || exit 0
# Don't mark the connection offline unless we know ppp brought it up.
test -e /var/run/chrony-ppp-up || exit 0
if ! ip r 2> /dev/null | grep -q '^default'; then
    chronyc offline > /dev/null 2>&1
fi
rm -f /var/run/chrony-ppp-up
exit 0
