Skip to content

Instantly share code, notes, and snippets.

@gbraad
Last active March 13, 2025 05:19
Show Gist options
  • Save gbraad/27d5e5885bd3f3d7aabc0c7d7ceebc04 to your computer and use it in GitHub Desktop.
Save gbraad/27d5e5885bd3f3d7aabc0c7d7ceebc04 to your computer and use it in GitHub Desktop.

Check for available port

port=8006;
while grep -q :${port} <<< $(ss -tunalp); do
  port=$(( port + 1 ))
done
echo "Using Port: ${port}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment