X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=blobdiff_plain;f=net%2Fmiau%2Ffiles%2Fmiau.init;h=4a71877b1456bac856456b72d89c66161f80930f;hp=1f5fb744907a1af26d141ee425c2d26b8519891b;hb=fa83e3f031c421f40c87669e643da079bcdcb5a8;hpb=2959a333f85d45557c09dbfcc95cc38add70fef7 diff --git a/net/miau/files/miau.init b/net/miau/files/miau.init index 1f5fb74490..4a71877b14 100644 --- a/net/miau/files/miau.init +++ b/net/miau/files/miau.init @@ -1,27 +1,24 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org START=50 -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" start() { - [ -f $DEFAULT ] && . $DEFAULT - [ "$ENABLE_MIAU" = "yes" ] || exit 0 [ -f /var/run/miau.pid ] && { echo "[ERROR] miau is running" exit 0 } - [ -d $LOG_DIR ] || mkdir -p $LOG_DIR + [ -d $LOG_DIR ] || mkdir -p $LOG_DIR /usr/bin/miau -f $OPTIONS > $OUT_LOG 2> $ERR_LOG & PID=$! - sleep 1 + sleep 1 if [ -d /proc/$PID ]; then - echo $PID > /var/run/miau.pid - else + echo $PID > /var/run/miau.pid + else echo "[ERROR] Unable to run miau as a daemon" fi }