From 7edf3584e9c0a8207517a945495961bbdf2de7aa Mon Sep 17 00:00:00 2001 From: Caleb Malchik Date: Thu, 7 Mar 2019 20:30:19 -0500 Subject: [PATCH 1/2] Make prifi.sh all-localhost listen for SIGINT instead of newline This allows prifi.sh to run in the background; before, it would receive SIGTTN and stop when backgrounded. --- prifi.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/prifi.sh b/prifi.sh index fe9b5d2cf..95837019a 100755 --- a/prifi.sh +++ b/prifi.sh @@ -260,6 +260,9 @@ case $1 in "$thisScript" relay > relay.log 2>&1 & RELAYPID=$! THISPGID=$(ps -o pgid= "$RELAYPID" | sed -e "s/^ //") + + trap 'echo; echo "Gonna run kill -TERM -- -$THISPGID"; kill -TERM -- -$THISPGID' 2 + echo -e "$okMsg" sleep "$sleeptime_between_spawns" @@ -281,10 +284,8 @@ case $1 in done - read -p "PriFi deployed. Press [enter] to kill all..." key - echo "Gonna run kill -TERM -- -\"$THISPGID\"" - - kill -TERM -- -"$THISPGID" + echo "PriFi deployed. Press ^C to kill all..." + wait ;; gen-id|Gen-Id|GEN-ID) From e2f508e9b5b66f582dd69c63920f8cc7149ef792 Mon Sep 17 00:00:00 2001 From: Caleb Malchik Date: Thu, 7 Mar 2019 20:36:46 -0500 Subject: [PATCH 2/2] Generate "Go >= 1.7.0 is required" message from $min_go_version --- helpers.lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers.lib.sh b/helpers.lib.sh index 66d22c95f..8692462d5 100644 --- a/helpers.lib.sh +++ b/helpers.lib.sh @@ -35,7 +35,7 @@ test_go(){ fi GO_VER=$(go version 2>&1 | sed 's/.*version go\([[:digit:]]*\)\.\([[:digit:]]*\)\(.*\)/\1\2/; 1q') if [ "$GO_VER" -lt "$min_go_version" ]; then - echo -e "$errorMsg Go >= 1.7.0 is required" + echo "$errorMsg Go >= $(echo $min_go_version | sed 's/./&./') is required" exit 1 fi }