Skip to content

Commit

Permalink
convert cerowrt to procd
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Taht committed Jan 23, 2014
1 parent d2d75c8 commit d1911de
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions utils/cerowrt-chrome/files/etc/init.d/cerowrt
@@ -1,22 +1,20 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006-2011 OpenWrt.org

START=50
PROG=/usr/sbin/lighttpd
CONFIGFILE=/etc/lighttpd/cerowrt.conf
LOGDIR=/var/log/lighttpd
USE_PROCD=1

BIN=lighttpd
DEFAULT=/etc/default/cerowrt
LOG_D=/var/log/cerowrt
RUN_D=/var/run
PID_F=$RUN_D/cerowrt.pid
OPTIONS="-f /etc/lighttpd/cerowrt.conf"
start_service() {
mkdir -m 0755 -p $LOGDIR

start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $LOG_D
mkdir -p $RUN_D
$BIN $OPTIONS
}
procd_open_instance
procd_set_param command $PROG -D -f $CONFIGFILE
procd_set_param file $CONFIGFILE
procd_set_param respawn
procd_close_instance

stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}

0 comments on commit d1911de

Please sign in to comment.