892c23c09084092d949876eae263c32e5f665ede
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
4 DEFAULT
="/etc/default/miau"
5 OPTIONS
="-d /etc/miau/"
6 LOG_DIR
="/var/log/miau"
7 ERR_LOG
="$LOG_DIR/error.log"
8 OUT_LOG
="$LOG_DIR/miau.log"
11 [ -f $DEFAULT ] && .
$DEFAULT
12 [ "$ENABLE_MIAU" = "yes" ] ||
exit 0
13 [ -f /var
/run
/miau.pid
] && {
14 echo "[ERROR] miau is running"
17 [ -d $LOG_DIR ] || mkdir
-p $LOG_DIR
18 /usr
/bin
/miau
-f $OPTIONS > $OUT_LOG 2> $ERR_LOG &
21 if [ -d /proc
/$PID ]; then
22 echo $PID > /var
/run
/miau.pid
24 echo "[ERROR] Unable to run miau as a daemon"
29 [ -f /var
/run
/miau.pid
] && kill $
(cat /var
/run
/miau.pid
) >/dev
/null
2>&1 && rm /var
/run
/miau.pid