From 67ec049f25e299957fada55ea8738e0967547c6f Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 18 Feb 2011 00:51:49 +0100 Subject: port totd, the trick or treat daemon This is a simple DNS-ALG implementation used for NAT-PT & Co. --- package/totd/files/totd.conf | 14 ++++++++++++++ package/totd/files/totd.conffiles | 1 + package/totd/files/totd.init | 26 ++++++++++++++++++++++++++ package/totd/files/totd.postinst | 4 ++++ 4 files changed, 45 insertions(+) create mode 100644 package/totd/files/totd.conf create mode 100644 package/totd/files/totd.conffiles create mode 100755 package/totd/files/totd.init create mode 100644 package/totd/files/totd.postinst (limited to 'package/totd/files') diff --git a/package/totd/files/totd.conf b/package/totd/files/totd.conf new file mode 100644 index 000000000..85a6ae73c --- /dev/null +++ b/package/totd/files/totd.conf @@ -0,0 +1,14 @@ +; you can have multiple forwarders, totd will always prefer +; forwarders listed early and only use forwarders listed later +; if the first ones are unresponsive. +forwarder ::1 + +; you can have multiple prefixes or even no prefixes at all +; totd uses them in round-robin fashion +prefix 0::ffff:ffff:0:0 + +; the port totd listens on for incoming requests +port 53 + +; the pidfile to use (default: /var/run/totd.pid) +pidfile /var/run/totd.pid diff --git a/package/totd/files/totd.conffiles b/package/totd/files/totd.conffiles new file mode 100644 index 000000000..c74a3007f --- /dev/null +++ b/package/totd/files/totd.conffiles @@ -0,0 +1 @@ +/etc/totd.conf diff --git a/package/totd/files/totd.init b/package/totd/files/totd.init new file mode 100755 index 000000000..665e36171 --- /dev/null +++ b/package/totd/files/totd.init @@ -0,0 +1,26 @@ +#!/bin/sh +#PKG totd +#INIT 60 +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + test x"${totd:-NO}" = x"NO" && exit 0 + exec sh $0 start + ;; +start) + totd $totd_flags -c /etc/totd.conf + ;; +stop) + pkill totd + ;; +restart) + sh $0 stop + sh $0 start + ;; +*) + echo "Usage: $0 {start | stop | restart}" + ;; +esac +exit $? diff --git a/package/totd/files/totd.postinst b/package/totd/files/totd.postinst new file mode 100644 index 000000000..12c7c1864 --- /dev/null +++ b/package/totd/files/totd.postinst @@ -0,0 +1,4 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf 'additional flags for totd' totd_flags "-q" +add_rcconf totd totd NO -- cgit v1.2.3