diff --git a/extensions/pknock/knock.sh b/extensions/pknock/knock.sh index 15fa100..c66316b 100755 --- a/extensions/pknock/knock.sh +++ b/extensions/pknock/knock.sh @@ -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 " 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"