Skip to content

Instantly share code, notes, and snippets.

@holmeszyx
Created June 28, 2012 09:21
Show Gist options
  • Select an option

  • Save holmeszyx/3010150 to your computer and use it in GitHub Desktop.

Select an option

Save holmeszyx/3010150 to your computer and use it in GitHub Desktop.
check ssh 7070
# pgrep -f "ssh -qTfnN"
NET=$(netstat -an | grep "7070")
NET_ST=$?
if [[ ${NET_ST} != 0 ]]; then
echo "ssh never opened"
else
echo "ssh opened"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment