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

Netcat not permanent

parent aad1ddf8
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ broadcast=$(ip a | awk '/inet.*eth1/ {print $4}' | cut -d / -f 1) ...@@ -26,7 +26,7 @@ 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) subnet=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1 | cut -d . -f 1-3)
while true while true
do do
MAC=`netcat -k -l $IP 9999` MAC=`netcat -l $IP 9999`
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 "$MAC" wakeonlan -i $broadcast "$MAC"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment