1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-12 04:10:17 +02:00
openwrt-xburst/package/owsip/files/telephony.init
blogic ae1aca2eb7 [ltq-vmmc] move /dev/vmmcX creation to a more central place
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32024 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-06-02 14:03:28 +00:00

34 lines
671 B
Bash

#!/bin/sh /etc/rc.common
START=80
SERVICE_WRITE_PID=1
SERVICE_DAEMONIZE=1
SERVICE_PID_FILE=/var/run/owsip.pid
. /lib/functions.sh
relay_set () {
local cfg="$1"
local gpio value
config_get gpio "$cfg" gpio
config_get value "$cfg" value
[ -n "gpio" ] || return 0
[ ! -f "/sys/class/gpio/gpio$gpio/direction" ] &&
echo "$gpio" > /sys/class/gpio/export
[ -f "/sys/class/gpio/gpio$gpio/direction" ] && {
echo "out" > /sys/class/gpio/gpio$gpio/direction
echo "$value" > /sys/class/gpio/gpio$gpio/value
}
}
start() {
config_load telephony
config_foreach relay_set relay
service_start /usr/bin/owsip_ua
}
stop() {
service_stop /usr/bin/owsip_ua
}