From 10914605a0bc6e011ee35540ae005d4c55e06478 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 7 Dec 2022 15:35:49 +0100 Subject: [PATCH] G1BILLETS + --- G1BILLETS.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/G1BILLETS.sh b/G1BILLETS.sh index 332757b..86316af 100755 --- a/G1BILLETS.sh +++ b/G1BILLETS.sh @@ -109,10 +109,11 @@ else ################################################################################ ## MAKE IT A NETWORK MICRO SERVICE -- PORTS : INPUT=33101 OUTPUT=33102 ############## CLEAN START DEAMON MODE ### - pidportinuse=$(ps axf --sort=+utime | grep -w "nc -l -p 33101" | grep -v -E 'color=auto|grep' | awk '{gsub(/^ +| +$/,"")} {print $0}' | tail -n 1 | cut -d " " -f 1) - [[ $pidportinuse ]] && kill -9 $pidportinuse && echo "KILLING 33101 $pidportinuse" - pidportinuse=$(ps axf --sort=+utime | grep -w "nc -l -p 33102" | grep -v -E 'color=auto|grep' | awk '{gsub(/^ +| +$/,"")} {print $0}' | tail -n 1 | cut -d " " -f 1) - [[ $pidportinuse ]] && kill -9 $pidportinuse && echo "KILLING NOT COLLECTED THREAD $pidportinuse" +pidportinuse=$(ps axf --sort=+utime | grep -w "nc -l -p 33101" | grep -v -E 'color=auto|grep' | awk '{gsub(/^ +| +$/,"")} {print $0}' | tail -n 1 | cut -d " " -f 1) +[[ $pidportinuse ]] && echo "KILLING OLD DEAMON 33101 $pidportinuse" && kill -9 $pidportinuse; killall G1BILLETS.sh + +pidportinuse=$(ps axf --sort=+utime | grep -w "nc -l -p 33102" | grep -v -E 'color=auto|grep' | awk '{gsub(/^ +| +$/,"")} {print $0}' | tail -n 1 | cut -d " " -f 1) +[[ $pidportinuse ]] && kill -9 $pidportinuse && echo "KILLING NOT COLLECTED THREAD $pidportinuse" ##################################################################### myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") @@ -226,7 +227,7 @@ cat ${ZFILE} >> ${MY_PATH}/tmp/http.${MOATS} # NETCAT PUBLISH port=33102 [[ $XDG_SESSION_TYPE != 'x11' ]] \ -&& cat ${MY_PATH}/tmp/http.${MOATS} | nc -l -p 33102 -q 1 > /dev/null 2>&1 \ +&& "33102 LOADING" && cat ${MY_PATH}/tmp/http.${MOATS} | nc -l -p 33102 -q 1 > /dev/null 2>&1 \ && echo "DELIVERED ${MOATS} : http://g1billet.localhost:33102" rm -f "${MY_PATH}/tmp/http.${MOATS}"