packages/iodine: use new service functions
[openwrt/svn-archive/archive.git] / net / iodine / files / iodined.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006-2011 OpenWrt.org
3
4 START=50
5
6 start_instance () {
7 local section="$1"
8 config_get address "$section" 'address'
9 config_get password "$section" 'password'
10 config_get tunnelip "$section" 'tunnelip'
11 config_get tld "$section" 'tld'
12
13 service_start /usr/sbin/iodined -l "$address" -P "$password" "$tunnelip" "$tld"
14 }
15
16 start() {
17 config_load 'iodined'
18 config_foreach start_instance 'iodined'
19 }
20
21 stop() {
22 service_stop /usr/sbin/iodined
23 }