aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tunnel/tunnel
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2017-12-03 23:27:09 +0200
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2017-12-03 23:27:09 +0200
commit0c32955f2ac048082d6995969f0782a52c459013 (patch)
treefe761784e6cca2d312e0979078dbe933c6a0ffb1 /testing/tunnel/tunnel
parentb42b1e228ca680aa74fc0a6a64c79c1b0ac30e51 (diff)
downloadaports-0c32955f2ac048082d6995969f0782a52c459013.tar.gz
aports-0c32955f2ac048082d6995969f0782a52c459013.tar.bz2
aports-0c32955f2ac048082d6995969f0782a52c459013.tar.xz
testing/tunnel: new package
Diffstat (limited to 'testing/tunnel/tunnel')
-rw-r--r--testing/tunnel/tunnel26
1 files changed, 26 insertions, 0 deletions
diff --git a/testing/tunnel/tunnel b/testing/tunnel/tunnel
new file mode 100644
index 0000000000..a710f6b644
--- /dev/null
+++ b/testing/tunnel/tunnel
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Tunnel interface configuration script
+# Copyright (c) 2017 Kaarle Ritvanen
+
+PARAMS=$(set | sed -E '
+ s/^IF_TUNNEL_([A-Z0-9_]+)=(.+)/\1\n\2/
+ ta
+ d
+ :a
+ h
+ y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+ P
+ g
+ s/.*\n//
+ ')
+
+[ "$PARAMS" ] || exit 0
+
+if [ $MODE = start ]; then
+ eval ip tunnel add $IFACE $PARAMS
+elif [ $MODE = stop ]; then
+ ip tunnel del $IFACE
+else
+ exit 1
+fi