Soft'N'Design Software
/
projects
/
debian6500.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2751033
)
correct service
author
Laurent Mazet
<laurent.mazet@thalesgroup.com>
Fri, 4 Dec 2015 19:02:55 +0000
(20:02 +0100)
committer
Laurent Mazet
<laurent.mazet@thalesgroup.com>
Fri, 4 Dec 2015 19:02:55 +0000
(20:02 +0100)
master/etc/init.d/etherwake
patch
|
blob
|
blame
|
history
master/etc/init.d/ipmiwake
patch
|
blob
|
blame
|
history
master/etc/init.d/shutdownallblades
patch
|
blob
|
blame
|
history
master/etc/init.d/wakeonlan
patch
|
blob
|
blame
|
history
diff --git
a/master/etc/init.d/etherwake
b/master/etc/init.d/etherwake
index 1fa7481e7497275ef3dcc87fcf7619c0fcdfb73f..3e011ffd0c7f3fa885a3e3135831257b74f0afb6 100755
(executable)
--- a/
master/etc/init.d/etherwake
+++ b/
master/etc/init.d/etherwake
@@
-47,7
+47,7
@@
do_start () {
n=0
while [ $NB_TRY -gt 0 ]; do
n=0
while [ $NB_TRY -gt 0 ]; do
- for mac in $(awk '{sub(/#.*/, "")} /trc[0-9]/ {gsub(/[;{}]/, " "); print $5}' $DHCPCONF); do
+ for mac in $(awk '{sub(/#.*/, "")} /
host\s+
trc[0-9]/ {gsub(/[;{}]/, " "); print $5}' $DHCPCONF); do
host=$(awk '{sub(/#.*/, "")} /'$mac'/ {gsub(/[{}]/, " "); print $2}' $DHCPCONF)
log_action_msg "Wake-up $host (EtherWake $mac)"
host=$(awk '{sub(/#.*/, "")} /'$mac'/ {gsub(/[{}]/, " "); print $2}' $DHCPCONF)
log_action_msg "Wake-up $host (EtherWake $mac)"
diff --git
a/master/etc/init.d/ipmiwake
b/master/etc/init.d/ipmiwake
index 4b1c0ca2b50405938a72c3e9eca8bc0c6a76506a..541f363d4d83d38393e3b7bb0dbff0190daa11b0 100755
(executable)
--- a/
master/etc/init.d/ipmiwake
+++ b/
master/etc/init.d/ipmiwake
@@
-35,8
+35,8
@@
do_action () {
ip addr add 10.133.25.1/24 dev eth0
ip addr add 10.133.25.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.25.\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 &
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 &
diff --git
a/master/etc/init.d/shutdownallblades
b/master/etc/init.d/shutdownallblades
index 29cfd31e596a62a177b37a96907953535790d4e1..ceb1183fd95ab146972f3964d79514a2983d17a2 100755
(executable)
--- a/
master/etc/init.d/shutdownallblades
+++ b/
master/etc/init.d/shutdownallblades
@@
-25,6
+25,7
@@
VER=1.3
# Description:
### END INIT INFO
# Description:
### END INIT INFO
+DHCPCONF=/etc/dhcp/dhcpd.conf
REBOOT="no"
TIMEOUT=15
ENABLE="yes"
REBOOT="no"
TIMEOUT=15
ENABLE="yes"
@@
-59,7
+60,7
@@
do_stop () {
fi
# shutdown all blades
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
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
diff --git
a/master/etc/init.d/wakeonlan
b/master/etc/init.d/wakeonlan
index d67a847532a40cfd1f35ec01c8962a78a8169305..32151e9b5ef957aa43a6dc87e003d0ec06ce5404 100755
(executable)
--- a/
master/etc/init.d/wakeonlan
+++ b/
master/etc/init.d/wakeonlan
@@
-41,8
+41,8
@@
do_start () {
log_action_msg "Activate Wake On Lan"
log_action_msg "Activate Wake On Lan"
- for mac in $(awk '{
sub(/#.*/, "") } /
trc[0-9]/ { gsub(/[;{}]/, " "); print $5}' $DHCPCONF); do
- broadcast=$(
grep $mac
$DHCPCONF | sed 's/.* \([0-9.]*\)\..*/\1.255/')
+ for mac in $(awk '{
sub(/#.*/, "")} /host\s+
trc[0-9]/ { gsub(/[;{}]/, " "); print $5}' $DHCPCONF); do
+ broadcast=$(
awk '{sub(/#.*/, "")} /'$mac'/ {print}'
$DHCPCONF | sed 's/.* \([0-9.]*\)\..*/\1.255/')
host=$(awk '{sub(/#.*/, "")} /'$mac'/ {gsub(/[{}]/, " "); print $2}' $DHCPCONF)
log_action_msg "Wake-up $host (WOL $mac $broadcast)"
wakeonlan -p 7 -i $broadcast $mac
host=$(awk '{sub(/#.*/, "")} /'$mac'/ {gsub(/[{}]/, " "); print $2}' $DHCPCONF)
log_action_msg "Wake-up $host (WOL $mac $broadcast)"
wakeonlan -p 7 -i $broadcast $mac