[dhcp/f18] 12-dhcpd NM dispatcher script now restarts also dhcpd6 service

Jiří Popelka jpopelka at fedoraproject.org
Thu Jan 17 16:46:10 UTC 2013


commit e812a0fa7bf00c9e2e6fc0a4a3088a438cc446ab
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Thu Jan 10 17:14:43 2013 +0100

    12-dhcpd NM dispatcher script now restarts also dhcpd6 service

 12-dhcpd |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/12-dhcpd b/12-dhcpd
index 2757988..1770696 100644
--- a/12-dhcpd
+++ b/12-dhcpd
@@ -1,11 +1,11 @@
 #!/bin/bash
-export LC_ALL=C
 
-# restart dhcpd whenever $1 interface is brought up by NM (rhbz #565921)
-if [ "$2" = "up" ]; then
-    # exit if the service is not configured to be started in the current runlevel
-    /bin/systemctl is-enabled dhcpd.service || exit 0
+INTERFACE=$1 # The interface which is brought up or down
+STATUS=$2 # The new state of the interface
 
-    # restart service
-    /bin/systemctl restart dhcpd.service || :
+# whenever interface is brought up by NM (rhbz #565921)
+if [ "$STATUS" = "up" ]; then
+    # restart the services
+    systemctl -q is-enabled dhcpd.service && systemctl restart dhcpd.service
+    systemctl -q is-enabled dhcpd6.service && systemctl restart dhcpd6.service
 fi


More information about the scm-commits mailing list