X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=master%2Fetc%2Finit.d%2Fshutdownallblades;h=ceb1183fd95ab146972f3964d79514a2983d17a2;hb=aa1a77f38ec5c946f83373ed76759cbc70cf17b5;hp=29cfd31e596a62a177b37a96907953535790d4e1;hpb=2751033a79ef82ea090624ede38dc8aeccd41727;p=debian6500.git diff --git a/master/etc/init.d/shutdownallblades b/master/etc/init.d/shutdownallblades index 29cfd31..ceb1183 100755 --- a/master/etc/init.d/shutdownallblades +++ b/master/etc/init.d/shutdownallblades @@ -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