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

Fix wakeonlan service

parent a5bb2a74
No related branches found
No related tags found
No related merge requests found
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
IP=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1) IP=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1)
broadcast=$(ip a | awk '/inet.*eth1/ {print $4}' | cut -d / -f 1) broadcast=$(ip a | awk '/inet.*eth1/ {print $4}' | cut -d / -f 1)
netcat -l $IP 9999 | \ netcat -k -l $IP 9999 | \
while read MAC while read MAC
do do
if [ $(echo "$MAC" | egrep -c "^([0-9a-f]{2}:?){6}$") -eq 1 ] if [ $(echo "$MAC" | egrep -c "^([0-9a-f]{2}:?){6}$") -eq 1 ]
then then
wakeonlan -i $broadcast "$line" wakeonlan -i $broadcast "$MAC"
fi fi
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment