You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
613 B

  1. #!/bin/sh /etc/rc.common
  2. START=50
  3. start_instance () {
  4. local section="$1"
  5. config_get address "$section" 'address'
  6. config_get port "$section" 'port'
  7. config_get resolver "$section" 'resolver'
  8. config_get resolvers_list "$section" 'resolvers_list'
  9. service_start /usr/sbin/dnscrypt-proxy -d \
  10. -a ${address}:${port} \
  11. -u nobody \
  12. -L ${resolvers_list:-'/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'} \
  13. -R ${resolver:-'opendns'}
  14. }
  15. start() {
  16. config_load 'dnscrypt-proxy'
  17. config_foreach start_instance 'dnscrypt-proxy'
  18. }
  19. stop() {
  20. service_stop /usr/sbin/dnscrypt-proxy
  21. }