lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

iodined.init (608B)


      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 	config_get port     "$section" 'port'
     13 	
     14 	test -n "$address" || address='0.0.0.0'
     15 	test -n "$port" || port='53'
     16 
     17 	service_start /usr/sbin/iodined -l "$address" -P "$password" -p "$port" "$tunnelip" "$tld"
     18 }
     19 
     20 start() {
     21 	config_load 'iodined'
     22 	config_foreach start_instance 'iodined'
     23 }
     24 
     25 stop() {
     26 	service_stop /usr/sbin/iodined
     27 }