call chronyc directly from logrotate and NM dispatcher scripts

This commit is contained in:
Miroslav Lichvar 2014-06-09 12:10:45 +02:00
parent 29a27a56ba
commit 22ea5da1ab
2 changed files with 3 additions and 3 deletions

View File

@ -3,6 +3,6 @@
nocreate nocreate
sharedscripts sharedscripts
postrotate postrotate
/usr/libexec/chrony-helper command cyclelogs > /dev/null 2>&1 || true /usr/bin/chronyc -a cyclelogs > /dev/null 2>&1 || true
endscript endscript
} }

View File

@ -4,12 +4,12 @@ export LC_ALL=C
if [ "$2" = "up" ]; then if [ "$2" = "up" ]; then
/sbin/ip route list dev "$1" | grep -q '^default' && /sbin/ip route list dev "$1" | grep -q '^default' &&
/usr/libexec/chrony-helper command online > /dev/null 2>&1 /usr/bin/chronyc -a online > /dev/null 2>&1
fi fi
if [ "$2" = "down" ]; then if [ "$2" = "down" ]; then
/sbin/ip route list | grep -q '^default' || /sbin/ip route list | grep -q '^default' ||
/usr/libexec/chrony-helper command offline > /dev/null 2>&1 /usr/bin/chronyc -a offline > /dev/null 2>&1
fi fi
exit 0 exit 0