linux script with netcat stops working after x hours

后端 未结 6 1873
闹比i
闹比i 2021-02-20 11:20

I\'ve have to scripts:

#!/bin/bash

netcat -lk -p 12345 | while read line
do
    match=$(echo $line | grep -c \'Keep-Alive\')
    if [ $match -eq 1 ]; then
              


        
6条回答
  •  生来不讨喜
    2021-02-20 12:08

    you may not use the -p option in the case you will wait for an incoming connect request. (see man page of nc) Hostname and Port are the last two arguments of the command line.

    May be it connects to the own port and after some hours there is some resource missing??

提交回复
热议问题