summarylogtreecommitdiffstats
path: root/tspc
diff options
context:
space:
mode:
authorshtrom2008-06-10 04:17:45 +0000
committershtrom2008-06-10 04:17:45 +0000
commit9b9daf8c760fd378fbabed618504a31a84e307e7 (patch)
tree252d87378241853c7afbe5d5a79a57996718b632 /tspc
parentb0a79c5aee89c20e9934953ffb8f13d4983ba8a7 (diff)
downloadaur-9b9daf8c760fd378fbabed618504a31a84e307e7.tar.gz
[tspc] Merged patch from Debian.
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/archlinux-packages@117 df209809-8e4a-0410-9a64-c169741eb0fc
Diffstat (limited to 'tspc')
-rwxr-xr-xtspc59
1 files changed, 59 insertions, 0 deletions
diff --git a/tspc b/tspc
new file mode 100755
index 000000000000..b21ffe9ae394
--- /dev/null
+++ b/tspc
@@ -0,0 +1,59 @@
+#! /bin/sh
+# $Id$
+# Startup script from the Debian tspc package
+# Written by Martin Waitz <tali@debian.org>
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+TSPC=/usr/sbin/tspc
+
+test -f $TSPC || exit 0
+
+
+# read tsp client config, to get the interface used
+. /etc/tsp/tspc.conf
+
+start() {
+ $TSPC || exit 1
+}
+
+stop() {
+ killall $TSPC || exit 1
+ ip tunnel del $if_tunnel_v6v4 2>/dev/null
+ ip tunnel del $if_tunnel_v6udpv6 2>/dev/null
+}
+
+
+case "$1" in
+ start)
+ echo -n "Setting up IPv6 tunnel: "
+ start
+ if test "$?" = 0; then
+ echo "done.";
+ else
+ echo "failed."
+ exit 1
+ fi
+ ;;
+ stop)
+ echo -n "Shutting down IPv6 tunnel: "
+ stop
+ echo "done."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting IPv6 tunnel: "
+ stop
+ start
+ if test "$?" = 0; then
+ echo "done.";
+ else
+ echo "failed."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0