source: packages/net/p910nd/files/p910nd.init @ 8596

Last change on this file since 8596 was 8596, checked in by olli, 9 years ago

p910nd:

  • Migrate configuration to UCI
  • Minor Makefile cleanups
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 815 bytes
Line 
1#!/bin/sh /etc/rc.common
2# Copyright (C) 2007 OpenWrt.org
3START=50
4
5BIN=p910nd
6
7start_service() {
8        local section="$1"
9        config_get      port          "$section" port
10        config_get      device        "$section" device
11        config_get_bool bidirectional "$section" bidirectional
12
13        options=""
14        [ $bidirectional -eq 1 ] && {
15                options="$options -b"
16        }
17        options="$options -f $device $port"
18
19        $BIN $options
20}
21
22stop_service() {
23        local section="$1"
24        config_get port "$section" port
25
26        PID_F=/var/run/p910${port}d.pid
27        [ -f $PID_F ] && kill $(cat $PID_F)
28}
29
30start() {
31        config_load "p910nd"
32        config_foreach start_service p910nd
33}
34
35stop() {
36        config_load "p910nd"
37        config_foreach stop_service p910nd
38}
Note: See TracBrowser for help on using the repository browser.