Got port check in bash script working
This commit is contained in:
parent
3f9a51fa3f
commit
9e27c802c3
1 changed files with 2 additions and 1 deletions
|
|
@ -13,10 +13,11 @@ do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
services=$( netstat -nl | grep '[^:]:'+ $PORT +'[ \t]')
|
services=$( netstat -nl | grep '[^:]:'$PORT'[ \t]')
|
||||||
test -n "$services" && {
|
test -n "$services" && {
|
||||||
echo "Warning: something is already using port " + $PORT
|
echo "Warning: something is already using port " + $PORT
|
||||||
echo " $services"
|
echo " $services"
|
||||||
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue