summaryrefslogtreecommitdiffstats
path: root/ship/lib/network
diff options
context:
space:
mode:
Diffstat (limited to 'ship/lib/network')
-rw-r--r--ship/lib/network11
1 files changed, 11 insertions, 0 deletions
diff --git a/ship/lib/network b/ship/lib/network
index bc4d1047..6c8970a0 100644
--- a/ship/lib/network
+++ b/ship/lib/network
@@ -76,6 +76,17 @@ run_telnet(){
port="$2"
$(which_telnet) "$host" "$port"
}
+port_open(){
+ # $1 - host
+ # $2 - port
+ # nc -zw 2 $1 $2
+ echo | run_telnet "$1" "$2" & pid=$!
+ { sleep 5; kill $pid;} & wid=$!
+ wait $pid
+ RET=$?
+ kill $wid >/dev/null 2>&1
+ return $RET
+}
send_irc(){
## reads from stdin, writes to IRC