]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
examples: align onoffline with DHCP NM dispatcher
authorRobert Fairley <rfairley@redhat.com>
Thu, 4 Jun 2020 18:48:40 +0000 (14:48 -0400)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 29 Jun 2020 15:43:49 +0000 (17:43 +0200)
Similar to the DHCP dispatcher, add a variable for the chronyc
executable path, which can be overwritten more easily by
downstream packages if needed.

Also give an `.onoffline` suffix to more clearly differentiate
this script from `chrony.nm-dispatcher.dhcp`.

examples/chrony.nm-dispatcher.onoffline [moved from examples/chrony.nm-dispatcher with 86% similarity]

similarity index 86%
rename from examples/chrony.nm-dispatcher
rename to examples/chrony.nm-dispatcher.onoffline
index 0b0c3e7103e5254212d5bb1d98eea4e0ca159701..34cfa0db8374878cfb65be5f2addc7b4048533fd 100644 (file)
@@ -5,11 +5,13 @@
 
 export LC_ALL=C
 
+chronyc=/usr/bin/chronyc
+
 # For NetworkManager consider only up/down events
 [ $# -ge 2 ] && [ "$2" != "up" ] && [ "$2" != "down" ] && exit 0
 
 # Note: for networkd-dispatcher routable.d ~= on and off.d ~= off
 
-chronyc onoffline > /dev/null 2>&1
+$chronyc onoffline > /dev/null 2>&1
 
 exit 0