Browse Source

Merge pull request #4374 from damianorenfer/dnscrypt-proxy-1.9.5_plugins

net/dnscrypt-proxy: ignore parameters requiring plugins support if no…
lilik-openwrt-22.03
Hannu Nyman 8 years ago
committed by GitHub
parent
commit
8c9dcacb46
2 changed files with 22 additions and 4 deletions
  1. +1
    -1
      net/dnscrypt-proxy/Makefile
  2. +21
    -3
      net/dnscrypt-proxy/files/dnscrypt-proxy.init

+ 1
- 1
net/dnscrypt-proxy/Makefile View File

@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dnscrypt-proxy PKG_NAME:=dnscrypt-proxy
PKG_VERSION:=1.9.5 PKG_VERSION:=1.9.5
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://download.dnscrypt.org/dnscrypt-proxy \ PKG_SOURCE_URL:=http://download.dnscrypt.org/dnscrypt-proxy \


+ 21
- 3
net/dnscrypt-proxy/files/dnscrypt-proxy.init View File

@ -18,6 +18,7 @@ dnscrypt_instance() {
create_config_file() { create_config_file() {
local address port resolver resolvers_list ephemeral_keys client_key syslog syslog_prefix local_cache query_log_file block_ipv6 provider_name provider_key resolver_address local address port resolver resolvers_list ephemeral_keys client_key syslog syslog_prefix local_cache query_log_file block_ipv6 provider_name provider_key resolver_address
local config_path="$2" local config_path="$2"
local plugins_support_enabled=$(dnscrypt-proxy --version | grep 'Support for plugins: present' | wc -l)
[ ! -d "$CONFIG_DIR" ] && mkdir -p "$CONFIG_DIR" [ ! -d "$CONFIG_DIR" ] && mkdir -p "$CONFIG_DIR"
[ -f "$config_path" ] && rm "$config_path" [ -f "$config_path" ] && rm "$config_path"
@ -36,7 +37,7 @@ create_config_file() {
config_get_bool ephemeral_keys $1 'ephemeral_keys' '0' config_get_bool ephemeral_keys $1 'ephemeral_keys' '0'
config_get_bool local_cache $1 'local_cache' '0' config_get_bool local_cache $1 'local_cache' '0'
config_get_bool block_ipv6 $1 'block_ipv6' '0' config_get_bool block_ipv6 $1 'block_ipv6' '0'
append_param_not_empty "ResolverName" "$resolver" $config_path append_param_not_empty "ResolverName" "$resolver" $config_path
append_param "ResolversList" "$resolvers_list" $config_path append_param "ResolversList" "$resolvers_list" $config_path
append_param_not_empty "ProviderName" "$provider_name" $config_path append_param_not_empty "ProviderName" "$provider_name" $config_path
@ -50,11 +51,28 @@ create_config_file() {
append_param "SyslogPrefix" "$syslog_prefix" $config_path append_param "SyslogPrefix" "$syslog_prefix" $config_path
append_on_off "LocalCache" $local_cache $config_path append_on_off "LocalCache" $local_cache $config_path
append_param_not_empty "QueryLogFile" "$query_log_file" $config_path append_param_not_empty "QueryLogFile" "$query_log_file" $config_path
append_yes_no "BlockIPv6" $block_ipv6 $config_path
if [ $plugins_support_enabled -ne 0 ]
then
append_yes_no "block_ipv6" $block_ipv6 $config_path
else
log_ignored_param "BlockIPv6"
fi
if [ $plugins_support_enabled -ne 0 ]
then
config_list_foreach $1 'blacklist' append_blacklists $config_path
else
log_ignored_param "blacklist"
fi
config_list_foreach $1 'blacklist' append_blacklists $config_path
} }
log_ignored_param() {
local param_name=$1
logger -t dnscrypt-proxy -p user.warn dnscrypt-proxy plugins support not present, ignoring $param_name parameter...
}
append_on_off() { append_on_off() {
local param_name=$1 local param_name=$1
local param_value=$2 local param_value=$2


Loading…
Cancel
Save