Created
May 13, 2016 15:37
-
-
Save caorong/78a17a9b4485bf02d21698ea6903bef7 to your computer and use it in GitHub Desktop.
find free port
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
i=8031; | |
for (( ; ; )) | |
do | |
_="$((i++))" | |
# echo "Number: $((i++))" | |
#netstat -apn|grep 8001|wc |awk '{print $1}' | |
X=$(netstat -apn|grep $i |wc|awk '{print $1}') | |
echo $X | |
if (( x < 1 )); then | |
echo use "$i" | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment