Skip to content
Snippets Groups Projects
Verified Commit fb41f2ec authored by David Beniamine's avatar David Beniamine
Browse files

Small fixes

parent 51055e6e
Branches
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@
IP=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1)
netcat="netcat -l $IP 9999"
KPID=`ps aux | grep \'$netcat\' | awk '{print $2}'`
[ ! -z "$PID" ] && kill $PID
[ ! -z "$KPID" ] && kill $KPID
subnet=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1 | cut -d . -f 1-3)
echo "$1" | netcat $subnet.52 9999
......
......@@ -24,9 +24,9 @@ getip(){
IP=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1)
broadcast=$(ip a | awk '/inet.*eth1/ {print $4}' | cut -d / -f 1)
subnet=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1 | cut -d . -f 1-3)
netcat -k -l $IP 9999 | \
while read MAC
while true
do
MAC=`netcat -k -l $IP 9999`
if [ $(echo "$MAC" | egrep -c "^([0-9a-f]{2}:?){6}$") -eq 1 ]
then
wakeonlan -i $broadcast "$MAC"
......@@ -40,4 +40,3 @@ netcat -k -l $IP 9999 | \
echo "$bootedip" | netcat $subnet.51 9999
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment