From d99978288fee3191ec53e503d902ec4c18ea5386 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Fri, 21 Jul 2023 22:18:04 +0300 Subject: [PATCH] more stable killable --- executor.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/executor.sh b/executor.sh index 8490729..a2995cf 100755 --- a/executor.sh +++ b/executor.sh @@ -18,7 +18,8 @@ timeline_home(){ remote_ip=$SOCAT_PEERADDR die(){ rm access_granted/"$remote_ip" - pkill executor.sh + echo 'bye' + pkill -P $PPID } mkdir -p -m 700 access_granted @@ -35,10 +36,12 @@ cat - | echo hi $remote_ip else die + break fi fi if [ ! -f access_granted/"$remote_ip" ]; then # Drop unregistred handshake die + break fi # --- case $cmd in @@ -57,7 +60,7 @@ cat - | *) echo 'only http(s)' ;; esac ;; - *) die ;; + *) die; break ;; esac printf 'bbs > ' done