leading space was breaking

This commit is contained in:
fred 2022-12-06 23:45:15 +01:00
parent 53c5df9246
commit 8850bfa301
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ while true; do
## RANDOM PORT SWAPPINESS AVOIDING COLLISION
## CHECK PORT IS FREE & KILL OLD ONE
pidportinuse=$(ps axf --sort=+utime | grep -w "nc -l -p ${PORT}" | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
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)
[[ $pidportinuse ]] && kill -9 $pidportinuse && echo "KILLING $pidportinuse" && continue
## CHECK 12345 PORT RUNNING (STATION FoF MAP)