#!/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 }