3 # ============================================================================
5 # Copyright (C) THALES. All rights reserved
6 # Author: Laurent Mazet & Thomas Perennou
8 # ============================================================================
12 # Required-Start: $network waitswitches
17 # Short-Description: IPMI wake cluster blades
18 # Description: Boot all cluster blades by IPMI boot command
21 DHCPCONF
=/etc
/dhcp
/dhcpd.conf
25 PATH
=/sbin
:/usr
/sbin
:/bin
:/usr
/bin
26 [ -f /etc
/default
/ipmiwake
] && .
/etc
/default
/ipmiwake
27 [ "$ENABLE" = "yes" ] ||
exit 0
29 .
/lib
/lsb
/init-functions
34 log_action_msg
"Send IPMI boot $ACTION command"
36 ip addr add
10.133.25.1/24 dev eth0
38 for mac
in $
(awk '{ sub(/#.*/, "") } /trc[0-9]/ && ! /-rf/ { gsub(/[;{}]/, " "); print $5}' $DHCPCONF); do
39 ipmi
=$
(grep $mac $DHCPCONF |
sed 's/.* [0-9.]*\.\([0-9][0-9]*\)[^0-9].*/10.133.25.\1/')
40 host=$
(awk '{sub(/#.*/, "")} /'$mac'/ {gsub(/[{}]/, " "); print $2}' $DHCPCONF)
41 log_action_msg
"Wake-up $host (IPMI boot $ACTION $ipmi)"
42 ipmipower
--session-timeout=$TIMEOUT -h $ipmi -u ADMIN
-p ADMIN
--$ACTION &
47 ip addr del
10.133.25.1/24 dev eth0
52 echo "$(basename $0), version $VER"
57 restart|reload|force-reload
)
58 echo "Error: argument '$1' not supported" >&2
65 echo "Usage: $0 start|stop" >&2
70 # vim:set tabstop=4 expandtab shiftwidth=4: