X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=master%2Fetc%2Finit.d%2Fetherwake;h=3e011ffd0c7f3fa885a3e3135831257b74f0afb6;hb=HEAD;hp=401992e9c37564c16bdf113271e9eba2a61b6636;hpb=605d1269a6d583df6b0f6a0fbeec1562a05aff28;p=debian6500.git diff --git a/master/etc/init.d/etherwake b/master/etc/init.d/etherwake index 401992e..3e011ff 100755 --- a/master/etc/init.d/etherwake +++ b/master/etc/init.d/etherwake @@ -1,5 +1,5 @@ #!/bin/sh -VER=1.3 +VER=1.4 # ============================================================================ # # Copyright (C) THALES. All rights reserved @@ -13,11 +13,13 @@ VER=1.3 # temps entre 2 wake # - V1.3: Laurent Mazet 02/05/2013 # Daemonisation +# - V1.4: Laurent Mazet & Thomas Perennou 03/12/2014 +# Legers correctifs # ============================================================================ ### BEGIN INIT INFO # Provides: etherwake -# Required-Start: $network +# Required-Start: $network waitswitches # Required-Stop: # Should-Start: # Default-Start: S @@ -45,10 +47,10 @@ do_start () { n=0 while [ $NB_TRY -gt 0 ]; do - for mac in $(awk '{sub(/#.*/, "")} /trc[0-9]/ {gsub(/;/, " "); print $6}' $DHCPCONF); do - host=$(awk '{sub(/#.*/, "")} /'$mac'/ {print $2}' $DHCPCONF) + 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 ($mac)" + log_action_msg "Wake-up $host (EtherWake $mac)" etherwake $mac n=$(expr $n + 1)