2007-03-17 11:34:51 +00:00
|
|
|
COMMAND=/usr/bin/chronyc
|
|
|
|
CHRONY_KEY=$(awk '/^1 / { print $2; }' /etc/chrony/chrony.keys)
|
|
|
|
|
|
|
|
chrony_control() {
|
|
|
|
$COMMAND << EOF
|
|
|
|
password $CHRONY_KEY
|
|
|
|
$1
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
|
2008-01-14 10:38:27 +00:00
|
|
|
[ -x $COMMAND ] && [ -n "$CHRONY_KEY" ] &&{
|
|
|
|
chrony_control online
|
|
|
|
}
|
2007-03-17 11:34:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[ "$ACTION" = "ifdown" -a "$INTERFACE" = "wan" ] && {
|
2008-01-14 10:38:27 +00:00
|
|
|
[ -x $COMMAND ] && [ -n "$CHRONY_KEY" ] &&{
|
|
|
|
chrony_control offline
|
|
|
|
}
|
2007-03-17 11:34:51 +00:00
|
|
|
}
|