]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_pknock: replace nemesis by socat
authorJan Engelhardt <jengelh@inai.de>
Fri, 22 Apr 2016 20:50:42 +0000 (22:50 +0200)
committerJan Engelhardt <jengelh@inai.de>
Fri, 22 Apr 2016 20:51:24 +0000 (22:51 +0200)
Use a utility much more widely available.

extensions/pknock/knock.sh

index 15fa100bc9fa929ccbfe1051831753adf5bdc642..c66316bcea1aef99c9fc37c6da02e1a25d242cba 100755 (executable)
@@ -1,15 +1,6 @@
 #!/bin/bash
-# $1 -> IP src
-# $2 -> IP dst
-# $3 -> PORT dst
-# $4 -> secret
-
-if [ -z $4 ]; then 
+if [ "$#" -ne 4 ]; then
     echo "usage: $0 <IP src> <IP dst> <PORT dst> <secret>"
     exit 1
 fi
-
-digest_file="/tmp/digest.txt"
-
-python ../test/py/gen_hmac.py $4 $1 > $digest_file
-nemesis udp -S $1 -D $2 -y $3 -P $digest_file
+python gen_hmac.py "$4" "$1" | socat - "udp-sendto:$2:$3,bind=$1"