changeset 19:b0057548801f

Startup script for rc.d
author darius@midget.dons.net.au
date Sun, 01 Feb 2009 10:31:27 +1030
parents 0baf9538a1b6
children 7a2ce1c1f176
files zbmux.sh
diffstat 1 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zbmux.sh	Sun Feb 01 10:31:27 2009 +1030
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+
+# PROVIDE: zbmux
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following line to /etc/rc.conf to enable `zbmux':
+#
+#zbmux_enable="YES"
+#
+
+. "/etc/rc.subr"
+
+name="zbmux"
+rcvar=`set_rcvar`
+
+base="/home/darius/projects/ZigBee"
+command="/usr/local/bin/twistd"
+command_args="-l $base/$name.log --pidfile=$base/$name.pid -y $base/$name.tac"
+pidfile="$base/$name.pid"
+required_files="$base/$name.tac"
+command_interpreter="/usr/local/bin/python2.5"
+zbmux_chdir="$base"
+
+# read configuration and set defaults
+load_rc_config "$name"
+: ${zbmux_enable="NO"}
+: ${zbmux_flags=""}
+: ${zbmux_user="darius"}
+
+run_rc_command "$1"