diff options
author | t3sserakt <t3ss@posteo.de> | 2023-01-18 09:54:24 +0100 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2023-01-18 09:54:24 +0100 |
commit | 369d046c3f2cda651b16498fc3b646338d15c170 (patch) | |
tree | 7514243ae54c32bd4738fb3457d59f8a2a6955ce /src | |
parent | 5e3980c4cf81bfac23adf11192d4708cfd291b9b (diff) | |
download | gnunet-369d046c3f2cda651b16498fc3b646338d15c170.tar.gz gnunet-369d046c3f2cda651b16498fc3b646338d15c170.zip |
TNG: Added script running miniupnpd on a router node for the nat upnp test case.
Diffstat (limited to 'src')
-rwxr-xr-x | src/transport/upnp.sh | 22 |
1 files changed, 22 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | if [ $2 -eq 1 ] | ||
4 | then | ||
5 | if [ ! -d /tmp/netjail_scripts ] | ||
6 | then | ||
7 | mkdir /tmp/netjail_scripts | ||
8 | fi | ||
9 | |||
10 | ext_ifname=$(ip addr |grep UP|grep "@"|awk -F: '{printf $2"\n"}'|tr -d " "|awk -F@ '{printf $1" "}'|awk '{printf $1}') | ||
11 | listening_ip=$(ip addr |grep UP|grep "@"|awk -F: '{printf $2"\n"}'|tr -d " "|awk -F@ '{printf $1" "}'|awk '{printf $2}') | ||
12 | uuid=$(uuidgen) | ||
13 | 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 | ||
14 | miniupnpd -d -f /tmp/netjail_scripts/gargoyle.txt -P /tmp/netjail_scripts/miniupnpd_$1.pid & | ||
15 | else | ||
16 | kill $(cat /tmp/netjail_scripts/miniupnpd_$1.pid) | ||
17 | fi | ||
18 | |||
19 | |||
20 | |||
21 | |||
22 | |||