X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=master%2Fetc%2Finit.d%2Fipmiwake;h=8f2da33a5747d6c2dfe53819f1d6f2f4e67e16cd;hb=HEAD;hp=4b1c0ca2b50405938a72c3e9eca8bc0c6a76506a;hpb=821b58059d03701f4214087e22888789963cd17f;p=debian6500.git diff --git a/master/etc/init.d/ipmiwake b/master/etc/init.d/ipmiwake index 4b1c0ca..8f2da33 100755 --- a/master/etc/init.d/ipmiwake +++ b/master/etc/init.d/ipmiwake @@ -33,10 +33,10 @@ do_action () { log_action_msg "Send IPMI boot $ACTION command" - ip addr add 10.133.25.1/24 dev eth0 + ip addr add 10.133.29.1/24 dev eth0 - for mac in $(awk '{ sub(/#.*/, "") } /trc[0-9]/ && ! /-rf/ { gsub(/[;{}]/, " "); print $5}' $DHCPCONF); do - ipmi=$(grep $mac $DHCPCONF | sed 's/.* [0-9.]*\.\([0-9][0-9]*\)[^0-9].*/10.133.25.\1/') + for mac in $(awk '{sub(/#.*/, "")} /host\s+trc[0-9]/ && ! /-rf/ { gsub(/[;{}]/, " "); print $5}' $DHCPCONF); do + ipmi=$(awk '{sub(/#.*/, "")} /'$mac'/ {print}' $DHCPCONF | sed 's/.* [0-9.]*\.\([0-9][0-9]*\)[^0-9].*/10.133.29.\1/') host=$(awk '{sub(/#.*/, "")} /'$mac'/ {gsub(/[{}]/, " "); print $2}' $DHCPCONF) log_action_msg "Wake-up $host (IPMI boot $ACTION $ipmi)" ipmipower --session-timeout=$TIMEOUT -h $ipmi -u ADMIN -p ADMIN --$ACTION & @@ -44,7 +44,7 @@ do_action () { wait - ip addr del 10.133.25.1/24 dev eth0 + ip addr del 10.133.29.1/24 dev eth0 } case "$1" in