3 # ============================================================================
5 # Copyright (C) THALES. All rights reserved
6 # Author: Jean-Noel Raguenes
8 # - V1.1: Herve Petit 10/03/2010
9 # reprise de la commande recuperation des @mac pour prendre
10 # en compte le fait que l'interface eth1 a ete configuree
11 # - V1.2: Herve Petit 04/06/2010
12 # etude probleme non demarrage lames esclave par tuning temps total et
14 # - V1.3: Laurent Mazet 02/05/2013
16 # - V1.4: Laurent Mazet & Thomas Perennou 03/12/2014
18 # ============================================================================
22 # Required-Start: $network waitswitches
27 # Short-Description: EW cluster blades
28 # Description: Boot all cluster blades by EtherWake protocol
31 DHCPCONF
=/etc
/dhcp
/dhcpd.conf
36 PATH
=/sbin
:/usr
/sbin
:/bin
:/usr
/bin
37 [ -f /etc
/default
/etherwake
] && .
/etc
/default
/etherwake
38 [ "$ENABLE" = "yes" ] ||
exit 0
40 .
/lib
/lsb
/init-functions
44 log_action_msg
"Activate EtherWake"
48 while [ $NB_TRY -gt 0 ]; do
50 for mac
in $
(awk '{sub(/#.*/, "")} /trc[0-9]/ {gsub(/[;{}]/, " "); print $5}' $DHCPCONF); do
51 host=$
(awk '{sub(/#.*/, "")} /'$mac'/ {gsub(/[{}]/, " "); print $2}' $DHCPCONF)
53 log_action_msg
"Wake-up $host (EtherWake $mac)"
57 [ $
(expr $n % $GROUP_SIZE) -eq 0 ] && sleep 1
61 NB_TRY
=$
(expr $NB_TRY - 1)
67 echo "$(basename $0), version $VER"
72 restart|reload|force-reload
)
73 echo "Error: argument '$1' not supported" >&2
80 echo "Usage: $0 start|stop" >&2
85 # vim:set tabstop=4 expandtab shiftwidth=4: