Skip to content

Instantly share code, notes, and snippets.

@denoww
Created December 22, 2022 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denoww/999fdddccf4cb3cc433e9be0c46e0c50 to your computer and use it in GitHub Desktop.
Save denoww/999fdddccf4cb3cc433e9be0c46e0c50 to your computer and use it in GitHub Desktop.
CHECK="do while"
while [[ ! -z $CHECK ]]; do
PORT=$(( ( RANDOM % 30000 ) + 1025 ))
CHECK=$(sudo netstat -ap | grep $PORT)
done
echo $PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment