summaryrefslogtreecommitdiffstats
path: root/scripts/listen-handshake.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/listen-handshake.sh')
-rwxr-xr-xscripts/listen-handshake.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/listen-handshake.sh b/scripts/listen-handshake.sh
index bf612e9..7ce55c6 100755
--- a/scripts/listen-handshake.sh
+++ b/scripts/listen-handshake.sh
@@ -7,13 +7,20 @@ if [ -z $1 ]; then
fi
IFACE="$1"
-
-NC="netcat -c"
+NC="/opt/ivysync/bin/netcat"
# check if it is openbsd netcat
-NC_ver="`netcat -h 2>&1|head -n 1 | awk '{print $1}'`"
+NC_ver="`$NC -h 2>&1|head -n 1 | awk '{print $1}'`"
if [ "$NC_ver" = "OpenBSD" ]; then
echo "using OpenBSD version of netcat"
- NC="netcat -q 0"
+ NC="$NC -q 0"
+elif [ "$NC_ver" = "GNU" ]; then
+ echo "using GNU version of netcat"
+ NC="$NC -c"
+else
+ echo "error: your version of netcat is not compatible"
+ echo "please install an OpenBSD or GNU netcat implementation"
+ echo "found on this system: `netcat -h 2>&1|head -n1`"
+ exit 1
fi
# some more version might be around that is not supported..
@@ -21,7 +28,7 @@ fi
IP="`ifconfig $IFACE | grep 'inet addr'| awk '{print $2}'|cut -f2 -d:`"
echo "listening on $IFACE configured with address $IP ..."
-master="`echo | $NC -u -l 3332`"
+master="`echo | $NC -u -l -p 3332`"
echo "contacted by master $master"
echo "$IP" | netcat -u $master 3331