aboutsummaryrefslogtreecommitdiff
path: root/net/iodine/files/iodined.init
blob: 48dea619dcee3f6bd8362e28edb147b308338f08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org

START=50

start_instance () {
	local section="$1"
	config_get address  "$section" 'address'
	config_get password "$section" 'password'
	config_get tunnelip "$section" 'tunnelip'
	config_get tld      "$section" 'tld'
	config_get port     "$section" 'port'
	
	test -n "$address" || address='0.0.0.0'
	test -n "$port" || port='53'

	service_start /usr/sbin/iodined -l "$address" -P "$password" -p "$port" "$tunnelip" "$tld"
}

start() {
	config_load 'iodined'
	config_foreach start_instance 'iodined'
}

stop() {
	service_stop /usr/sbin/iodined
}