50d1b76d54
* move DESCRIPTION to a separate macro * add conffiles back * indent initscript and config file * supply reasonable default config values git-svn-id: svn://svn.openwrt.org/openwrt/packages@8597 3c298f89-4303-0410-b956-a3cf2f4a3e73
39 lines
682 B
Bash
39 lines
682 B
Bash
#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2007 OpenWrt.org
|
|
START=50
|
|
|
|
BIN=p910nd
|
|
|
|
start_service() {
|
|
local section="$1"
|
|
config_get port "$section" port
|
|
config_get device "$section" device
|
|
config_get_bool bidirectional "$section" bidirectional
|
|
|
|
options=""
|
|
[ $bidirectional -eq 1 ] && {
|
|
options="$options -b"
|
|
}
|
|
options="$options -f $device $port"
|
|
|
|
$BIN $options
|
|
}
|
|
|
|
stop_service() {
|
|
local section="$1"
|
|
config_get port "$section" port
|
|
|
|
PID_F=/var/run/p910${port}d.pid
|
|
[ -f $PID_F ] && kill $(cat $PID_F)
|
|
}
|
|
|
|
start() {
|
|
config_load "p910nd"
|
|
config_foreach start_service p910nd
|
|
}
|
|
|
|
stop() {
|
|
config_load "p910nd"
|
|
config_foreach stop_service p910nd
|
|
}
|