Skip to content
Browse files

added simple port monitor

  • Loading branch information...
1 parent 6641268 commit 78efa19562dba09690871da6d2e5cd7e12e6e39c James Gray committed Mar 15, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 monitor-port
View
12 monitor-port
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+while true; do
+ echo -n "$(date +%H:%M:%S): "
+ nc -w 2 -z "$1 $2 $3"
+ if [ $? -eq 0 ]; then
+ echo "open"
+ else
+ echo "closed"
+ fi
+ sleep "$3"
+done

0 comments on commit 78efa19

Please sign in to comment.
Something went wrong with that request. Please try again.