summaryrefslogtreecommitdiff
path: root/package/miau/files/S50miau
diff options
context:
space:
mode:
authorwbx <wbx@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-03-15 13:40:51 +0000
committerwbx <wbx@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-03-15 13:40:51 +0000
commit5b20cab69c875e41b14653b467a02d5d185a0a5f (patch)
treea404dab98675dce4f7f233759e48324b84149a4d /package/miau/files/S50miau
parentf59578a083f9ac8746da5fe0910677756b118df8 (diff)
add miau from Benjamin Binier, updated to newest upstream, thx. add syslog-ng from Sebastien Bourgasser, pending missing libol package
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@3378 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/miau/files/S50miau')
-rwxr-xr-xpackage/miau/files/S50miau32
1 files changed, 32 insertions, 0 deletions
diff --git a/package/miau/files/S50miau b/package/miau/files/S50miau
new file mode 100755
index 0000000000..beef3105dd
--- /dev/null
+++ b/package/miau/files/S50miau
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+DEFAULT="/etc/default/miau"
+OPTIONS="-d /etc/miau/"
+LOG_DIR="/var/log/miau"
+ERR_LOG="$LOG_DIR/error.log"
+OUT_LOG="$LOG_DIR/miau.log"
+
+[ -f $DEFAULT ] && . $DEFAULT
+[ "$ENABLE_MIAU" = "yes" ] || exit 0
+
+case $1 in
+ start)
+ [ -f /var/run/miau.pid ] && echo "[ERROR] miau is running"
+ [ -f /var/run/miau.pid ] && exit 0
+ [ -d /var/run ] || mkdir -p /var/run
+ [ -d $LOG_DIR ] || mkdir -p $LOG_DIR
+ /usr/bin/miau -f $OPTIONS > $OUT_LOG 2> $ERR_LOG &
+ PID=$!
+ sleep 1
+ [ -d /proc/$PID ] && echo $PID > /var/run/miau.pid
+ [ -d /proc/$PID ] || echo "[ERROR] Unable to run miau as a daemon"
+ ;;
+ stop)
+ [ -f /var/run/miau.pid ] && kill $(cat /var/run/miau.pid) >/dev/null 2>&1 && rm /var/run/miau.pid
+ ;;
+ *)
+ echo "usage: $0 (start|stop)"
+ exit 1
+esac
+
+exit $?