From d5093f90dbcca0ed71bcda8a162efb9f817bcde2 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 6 May 2023 03:35:08 +0200 Subject: [PATCH] zipipipzz --- 12345.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/12345.sh b/12345.sh index 75f48a29..2dcb54a7 100755 --- a/12345.sh +++ b/12345.sh @@ -14,7 +14,7 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized . "${MY_PATH}/tools/my.sh" PORT=12345 -[[ ${isLAN} && ${zIP} ]] && PORT=45780 +[[ ${zIP} ]] && PORT=45780 YOU=$(myIpfsApi); ## API of $USER running ipfs echo "YOU=$YOU" @@ -68,7 +68,7 @@ while true; do [ ${PORT} -le 12345 ] && PORT=$((PORT+${RANDOM:0:2})) || PORT=$((PORT-${RANDOM:0:2})) ## RANDOM PORT SWAPPINESS AVOIDING COLLISION # ZIP - [[ ${zIP} ]] && PORT=$((PORT+1)) && [ ${PORT} -ge 45782 ] && PORT=45780 ## yunohost : OPEN FIREWALL 1234 12345 45780 45781 + [[ ${zIP} ]] && PORT=$((PORT+1)) && [ ${PORT} -gt 45782 ] && PORT=45780 || ## yunohost : OPEN FIREWALL 1234 12345 45780 45781 ## CHECK PORT IS FREE & KILL OLD ONE pidportinuse=$(ps axf --sort=+utime | grep -w "nc -l -p ${PORT}" | grep -v -E 'color=auto|grep' | awk '{gsub(/^ +| +$/,"")} {print $0}' | tail -n 1 | cut -d " " -f 1)