File: ip-down

package info (click to toggle)
chrony 1.21z-5
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 2,080 kB
  • ctags: 2,375
  • sloc: ansic: 14,831; yacc: 858; sh: 588; perl: 426; makefile: 148
file content (18 lines) | stat: -rw-r--r-- 666 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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.

/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
KEY=$(awk '$1 ~ /^commandkey$/ { print $2; exit}' /etc/chrony/chrony.conf)
PASSWORD=`awk '$1 ~ /^'$KEY'$/ {print $2; exit}' /etc/chrony/chrony.keys`
/usr/bin/chronyc << EOF
password $PASSWORD
offline
EOF
rm -f /var/run/chrony-ppp-up
exit 0