gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 02/07: TNG: Added script running miniupnpd on a router node for


From: gnunet
Subject: [gnunet] 02/07: TNG: Added script running miniupnpd on a router node for the nat upnp test case.
Date: Wed, 18 Jan 2023 10:50:54 +0100

This is an automated email from the git hooks/post-receive script.

t3sserakt pushed a commit to branch master
in repository gnunet.

commit 369d046c3f2cda651b16498fc3b646338d15c170
Author: t3sserakt <t3ss@posteo.de>
AuthorDate: Wed Jan 18 09:54:24 2023 +0100

    TNG: Added script running miniupnpd on a router node for the nat upnp test 
case.
---
 src/transport/upnp.sh | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/transport/upnp.sh b/src/transport/upnp.sh
new file mode 100755
index 000000000..d01a1a1a1
--- /dev/null
+++ b/src/transport/upnp.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+if [ $2 -eq 1 ]
+then
+    if [ ! -d /tmp/netjail_scripts ]
+    then
+        mkdir /tmp/netjail_scripts
+    fi
+
+    ext_ifname=$(ip addr |grep UP|grep "@"|awk -F: '{printf $2"\n"}'|tr  -d " 
"|awk -F@ '{printf $1" "}'|awk '{printf $1}')
+    listening_ip=$(ip addr |grep UP|grep "@"|awk -F: '{printf $2"\n"}'|tr  -d 
" "|awk -F@ '{printf $1" "}'|awk '{printf $2}')
+    uuid=$(uuidgen)
+    cat miniupnpd.conf |sed 
's/#ext_ifname=eth1/ext_ifname='$ext_ifname'/g'|sed 
's/#listening_ip=eth0/listening_ip='$listening_ip'/g'|sed 
's/uuid=73a9cb68-a00b-4d2c-8412-75fc989f0c6/uuid='$uuid'/g'|grep -v "^#"|grep 
-v '^$' > /tmp/netjail_scripts/gargoyle.txt
+    miniupnpd -d -f /tmp/netjail_scripts/gargoyle.txt -P 
/tmp/netjail_scripts/miniupnpd_$1.pid &
+else
+    kill $(cat /tmp/netjail_scripts/miniupnpd_$1.pid)
+fi
+
+
+
+
+

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]