correct service
[debian6500.git] / master / etc / init.d / shutdownallblades
index 29cfd31e596a62a177b37a96907953535790d4e1..ceb1183fd95ab146972f3964d79514a2983d17a2 100755 (executable)
@@ -25,6 +25,7 @@ VER=1.3
 # Description:
 ### END INIT INFO
 
+DHCPCONF=/etc/dhcp/dhcpd.conf
 REBOOT="no"
 TIMEOUT=15
 ENABLE="yes"
@@ -59,7 +60,7 @@ do_stop () {
     fi
 
     # shutdown all blades
-    for host in $(awk '{sub(/#.*/, "")} /trc[0-9][0-9]/ && ! /-rf/ {print $2}' /etc/dhcp/dhcpd.conf); do
+    for host in $(awk '{sub(/#.*/, "")} /host\s+trc[0-9][0-9]/ && ! /-rf/ {print $2}' $DHCPCONF); do
        grep $host /etc/hosts >&/dev/null || continue
        ( ping -c 1 $host >&/dev/null && { log_action_msg "shutdowning ${host/_1}"; ssh root@$host service $cmd stop; } ) &
     done