3 # ============================================================================
5 # Copyright (C) THALES. All rights reserved
6 # Author: Laurent Mazet
8 # ============================================================================
12 # Required-Start: $network waitswitches
17 # Short-Description: Wake cluster blades (AMM command)
18 # Description: Boot all cluster blades by AMM power command
23 SCRIPTS
=/opt
/script
/set_blade_power.tcl
/opt
/trc6500
/script
/set_blade_power.tcl
26 PATH
=/sbin
:/usr
/sbin
:/bin
:/usr
/bin
28 [ -f /etc
/default
/ammwake
] && .
/etc
/default
/ammwake
29 for s
in $SCRIPTS; do [ -x $s ] && SCRIPT
=$s; done
30 [ -x "$SCRIPT" ] ||
exit 1
31 [ "$ENABLE" = "yes" ] ||
exit 0
33 .
/lib
/lsb
/init-functions
38 log_action_msg
"Send AMM power $ACTION command"
40 for amm
in $
(awk '{ sub(/#.*/, "") } /amm[0-9]/ { print $2}' $HOSTS); do
41 ping -c 1 $amm >&/dev
/null ||
continue
42 for id
in $
(seq 1 14); do
43 [ $id -eq 1 -a "$amm" = amm00
] && continue
45 log_action_msg
"Wake-up blade-$id (AMM $amm $id $ACTION)"
46 $SCRIPT $amm -b $id -$ACTION >&/dev
/null || log_failure_msg
"Can't power $ACTION blade $id on $amm"
53 echo "$(basename $0), version $VER"
58 restart|reload|force-reload
)
59 echo "Error: argument '$1' not supported" >&2
66 echo "Usage: $0 start|stop" >&2
71 # vim:set tabstop=4 expandtab shiftwidth=4: