#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
START=98
|
|
STOP=10
|
|
USE_PROCD=1
|
|
NAME=linknx
|
|
PROG=/usr/bin/$NAME
|
|
|
|
. /lib/functions.sh
|
|
|
|
start_service() {
|
|
local conf
|
|
config_load "$NAME"
|
|
config_get conf args conf '/etc/linknx.xml'
|
|
[ -f "$conf" ] || cp -p /etc/linknx.xml.dist "$conf"
|
|
mkdir -p /tmp/$NAME/persist
|
|
|
|
procd_open_instance
|
|
procd_set_param command "$PROG"
|
|
procd_append_param command --config="$conf" -w
|
|
procd_set_param file "$conf"
|
|
procd_set_param pidfile /var/run/linknx.pid
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_close_instance
|
|
}
|