From 6234fdb9cd7062e180b0af55a8475c40f147f1f7 Mon Sep 17 00:00:00 2001 From: Fridrich von Stauffenberg Date: Sat, 12 Nov 2011 07:44:37 -0200 Subject: network/miredo: Added (teredo IPv6 tunneling) Signed-off-by: Niels Horn --- network/miredo/rc.miredo | 88 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 network/miredo/rc.miredo (limited to 'network/miredo/rc.miredo') diff --git a/network/miredo/rc.miredo b/network/miredo/rc.miredo new file mode 100644 index 000000000000..0ba5d706efcb --- /dev/null +++ b/network/miredo/rc.miredo @@ -0,0 +1,88 @@ +#!/bin/sh +# +# Miredo - Teredo IPv6 tunnelling +# +# Init script for miredo client. +# +# Written by Fridrich von Stauffenberg +# Based on tor's init script by Marco Bonetti + +PIDFILE=/var/run/miredo.pid +DAEMON=/usr/sbin/miredo + +miredo_start() { + echo "Starting Miredo: $DAEMON" + $DAEMON +} + +miredo_stop() { + echo -n "Stopping Miredo... " + PID=$(cat $PIDFILE 2>/dev/null) + if [ -z "$PID" ]; then + echo "not running." + exit 0 + fi + if kill -15 $PID; then + echo "stopped." + else + sleep 1 + if kill -9 $PID; then + echo "killed." + else + echo "error!" + exit 1 + fi + fi +} + +miredo_reload() { + echo -n "Reloading Miredo... " + PID=$(cat $PIDFILE 2>/dev/null) + if [ -z "$PID" ]; then + echo "not running." + exit 0 + fi + if kill -1 $PID; then + echo "reloaded." + else + echo "error!" + exit 1 + fi +} + +miredo_status() { + PID=$(cat $PIDFILE 2>/dev/null) + if [ -z "$PID" ]; then + echo "Not running." + exit 1 + elif kill -0 $PID; then + echo "Running with PID $PID." + exit 0 + else + echo "PID file $PIDFILE present, but PID $PID is not running." + exit 1 + fi +} + +case "$1" in + start) + miredo_start + ;; + stop) + miredo_stop + ;; + restart) + miredo_stop + sleep 1 + miredo_start + ;; + reload) + miredo_reload + ;; + status) + miredo_status + ;; + *) + echo "Usage: $0 (start|stop|restart|reload|status)" + ;; +esac -- cgit v1.2.3