ath9k: fix another tx locking issue
[openwrt.git] / package / linux-atm / files / br2684ctl
1 #!/bin/sh /etc/rc.common
2
3 START=50
4
5 SERVICE_DAEMONIZE=1
6 SERVICE_WRITE_PID=1
7
8 start_daemon() {
9 local cfg="$1"
10
11 local atmdev
12 config_get atmdev "$cfg" atmdev 0
13
14 local unit
15 config_get unit "$cfg" unit 0
16
17 local vpi
18 config_get vpi "$cfg" vpi 8
19
20 local vci
21 config_get vci "$cfg" vci 35
22
23 local encaps
24 config_get encaps "$cfg" encaps
25
26 case "$encaps" in
27 1|vc) encaps=1;;
28 *) encaps=0;;
29 esac
30
31 local payload
32 config_get payload "$cfg" payload
33
34 case "$payload" in
35 0|routed) payload=0;;
36 *) payload=1;;
37 esac
38
39 local qos
40 config_get qos "$cfg" qos
41
42 local sendsize
43 config_get sendsize "$cfg" sendsize
44
45 local circuit="$atmdev.$vpi.$vci"
46
47 SERVICE_PID_FILE="/var/run/br2684ctl-$circuit.pid" \
48 service_start /usr/sbin/br2684ctl \
49 -c "$unit" -e "$encaps" -p "$payload" \
50 -a "$circuit" ${qos:+-q "$qos"} ${sendsize:+-s "$sendsize"}
51 }
52
53 stop_daemon() {
54 local cfg="$1"
55
56 local atmdev
57 config_get atmdev "$cfg" atmdev 0
58
59 local unit
60 config_get unit "$cfg" unit 0
61
62 local vpi
63 config_get vpi "$cfg" vpi 8
64
65 local vci
66 config_get vci "$cfg" vci 35
67
68 local circuit="$atmdev.$vpi.$vci"
69
70 SERVICE_PID_FILE="/var/run/br2684ctl-$circuit.pid" \
71 service_stop /usr/sbin/br2684ctl
72 }
73
74 start() {
75 config_load network
76 config_foreach start_daemon atm-bridge
77 }
78
79 stop() {
80 config_load network
81 config_foreach stop_daemon atm-bridge
82 }
This page took 0.043235 seconds and 5 git commands to generate.