From 95fbba75246cf1b5115bc5493d3119f9ea91221e Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 27 Apr 2014 18:18:08 +0200 Subject: update things --- ship/lib/network | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ship/lib/network') 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 -- cgit v1.2.3