iodined.init 608 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2006-2011 OpenWrt.org
  3. START=50
  4. start_instance () {
  5. local section="$1"
  6. config_get address "$section" 'address'
  7. config_get password "$section" 'password'
  8. config_get tunnelip "$section" 'tunnelip'
  9. config_get tld "$section" 'tld'
  10. config_get port "$section" 'port'
  11. test -n "$address" || address='0.0.0.0'
  12. test -n "$port" || port='53'
  13. service_start /usr/sbin/iodined -l "$address" -P "$password" -p "$port" "$tunnelip" "$tld"
  14. }
  15. start() {
  16. config_load 'iodined'
  17. config_foreach start_instance 'iodined'
  18. }
  19. stop() {
  20. service_stop /usr/sbin/iodined
  21. }