diff --git a/wol/scripts/get_registry.sh b/wol/scripts/get_registry.sh old mode 100644 new mode 100755 index 38c171fc655e05b70fae8009be10fa3319553ef3..7dd7c7b43f46c3285d39910e74cef4d7701a91e9 --- a/wol/scripts/get_registry.sh +++ b/wol/scripts/get_registry.sh @@ -17,18 +17,13 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. IP=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1) -netcat="netcat -l $IP 9999" +port=9999 +netcat="netcat -l $IP $port" KPID=`ps aux | grep "$netcat" | awk '{print $2}'` -[ ! -z "$KPID" ] && kill $KPID +[ ! -z "$KPID" ] && kill $KPID > /dev/null 2>&1 subnet=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1 | cut -d . -f 1-3) host=$subnet.52 -port=9999 echo "get_registry" | netcat $host $port -nline=$($netcat | cut -d ' ' -f 1) -i=0; -for i in $(seq 1 $nline) -do - $netcat -done +stdbuf -i0 $netcat diff --git a/wol/scripts/wakeonlanservice.sh b/wol/scripts/wakeonlanservice.sh index 8f61fcf4ed10afb1e1725260b079b9a8f98aea2c..5823e5cfb3ed4f49afaf8dab1532243e5d13f1b1 100755 --- a/wol/scripts/wakeonlanservice.sh +++ b/wol/scripts/wakeonlanservice.sh @@ -47,11 +47,6 @@ do done elif [ $MAC == "get_registry" ] then - hostfile="/etc/registry/hosts" - wc -l $hostfile | netcat $host $port - while read line - do - echo "$line" | netcat $host $port - done < $hostfile + stdbuf -oL cat /etc/registry/hosts | netcat $host $port fi done