2006-10-04 20:57:49 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2007-09-03 14:48:21 +00:00
|
|
|
# Copyright (C) 2007 OpenWrt.org
|
2007-05-10 10:38:53 +00:00
|
|
|
START=50
|
2006-07-24 15:31:03 +00:00
|
|
|
|
2007-09-03 14:48:21 +00:00
|
|
|
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)
|
|
|
|
}
|
2006-07-24 15:31:03 +00:00
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
start() {
|
2007-09-03 14:48:21 +00:00
|
|
|
config_load "p910nd"
|
|
|
|
config_foreach start_service p910nd
|
2006-07-24 15:31:03 +00:00
|
|
|
}
|
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
stop() {
|
2007-09-03 14:48:21 +00:00
|
|
|
config_load "p910nd"
|
|
|
|
config_foreach stop_service p910nd
|
2006-07-24 15:31:03 +00:00
|
|
|
}
|