kernel: update linux 3.2 to 3.2.12
[openwrt.git] / package / owsip / files / telephony.init
1 #!/bin/sh /etc/rc.common
2 START=80
3
4 SERVICE_WRITE_PID=1
5 SERVICE_DAEMONIZE=1
6 SERVICE_PID_FILE=/var/run/owsip.pid
7
8 . /lib/functions.sh
9
10 load_module() {
11 MODULE=`lsmod | grep vmmc`
12 [ ! -z "$MODULE" ] || ( insmod vmmc ; sleep 3 )
13 [ ! -c /dev/vmmc10 ] && {
14 mknod /dev/vmmc10 c 122 10
15 mknod /dev/vmmc11 c 122 11
16 mknod /dev/vmmc12 c 122 12
17 mknod /dev/vmmc13 c 122 13
18 mknod /dev/vmmc14 c 122 14
19 mknod /dev/vmmc15 c 122 15
20 mknod /dev/vmmc16 c 122 16
21 mknod /dev/vmmc17 c 122 17
22 mknod /dev/vmmc18 c 122 18
23 }
24 }
25
26 relay_set () {
27 local cfg="$1"
28 local gpio value
29
30 config_get gpio "$cfg" gpio
31 config_get value "$cfg" value
32 [ -n "gpio" ] || return 0
33 [ ! -f "/sys/class/gpio/gpio$gpio/direction" ] &&
34 echo "$gpio" > /sys/class/gpio/export
35 [ -f "/sys/class/gpio/gpio$gpio/direction" ] && {
36 echo "out" > /sys/class/gpio/gpio$gpio/direction
37 echo "$value" > /sys/class/gpio/gpio$gpio/value
38 }
39 }
40
41 start() {
42 config_load telephony
43 config_foreach relay_set relay
44 load_module
45 service_start /usr/bin/owsip_ua
46 }
47
48 stop() {
49 service_stop /usr/bin/owsip_ua
50 }
This page took 0.05572 seconds and 5 git commands to generate.