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.

29 lines
701 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. config_get_bool ephemeral_keys "$section" 'ephemeral_keys'
  10. service_start /usr/sbin/dnscrypt-proxy -d \
  11. -a ${address}:${port} \
  12. -u nobody \
  13. -L ${resolvers_list:-'/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'} \
  14. -R ${resolver:-'opendns'} \
  15. ${ephemeral_keys:+'-E'}
  16. }
  17. start() {
  18. config_load 'dnscrypt-proxy'
  19. config_foreach start_instance 'dnscrypt-proxy'
  20. }
  21. stop() {
  22. service_stop /usr/sbin/dnscrypt-proxy
  23. }