From 1a7b5e3f9a7ce8997d2695164d3524529eeba0a1 Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@tetras-libre.fr>
Date: Mon, 12 Sep 2022 15:11:35 +0200
Subject: [PATCH] Force closing connections

---
 wol/scripts/actions.sh          | 2 +-
 wol/scripts/get_registry.sh     | 2 +-
 wol/scripts/sendmac.sh          | 2 +-
 wol/scripts/wakeonlanservice.sh | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/wol/scripts/actions.sh b/wol/scripts/actions.sh
index 308a936..0c53e8a 100755
--- a/wol/scripts/actions.sh
+++ b/wol/scripts/actions.sh
@@ -26,5 +26,5 @@ subnet=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1 | cut -d . -
 host=$subnet.52
 
 
-echo $@ | netcat $host $port
+echo $@ | netcat -N $host $port
 stdbuf -i0 -o0 -e0 $netcat
diff --git a/wol/scripts/get_registry.sh b/wol/scripts/get_registry.sh
index 7dd7c7b..e1a0470 100755
--- a/wol/scripts/get_registry.sh
+++ b/wol/scripts/get_registry.sh
@@ -25,5 +25,5 @@ KPID=`ps aux | grep "$netcat" | awk '{print $2}'`
 subnet=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1 | cut -d . -f 1-3)
 host=$subnet.52
 
-echo "get_registry" | netcat $host $port
+echo "get_registry" | netcat -N $host $port
 stdbuf -i0 $netcat
diff --git a/wol/scripts/sendmac.sh b/wol/scripts/sendmac.sh
index 02fce1e..f961b96 100755
--- a/wol/scripts/sendmac.sh
+++ b/wol/scripts/sendmac.sh
@@ -25,5 +25,5 @@ subnet=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1 | cut -d . -
 host=$subnet.52
 port=9999
 
-echo "$1" | netcat $host $port
+echo "$1" | netcat -N $host $port
 $netcat
diff --git a/wol/scripts/wakeonlanservice.sh b/wol/scripts/wakeonlanservice.sh
index b04dc49..92545ae 100755
--- a/wol/scripts/wakeonlanservice.sh
+++ b/wol/scripts/wakeonlanservice.sh
@@ -25,9 +25,9 @@ getip(){
 answer(){
     if [ -z "$1" ]
     then
-        netcat $host $port
+        netcat -N $host $port
     else
-        netcat $host $port < $1
+        netcat -N $host $port < $1
     fi
 }
 
-- 
GitLab