Fix shellcheck warnings in newly imported __unbound type

This commit is contained in:
fnux 2020-06-03 15:08:04 +02:00
parent 6b38b248e2
commit 3d3a3ef802
2 changed files with 14 additions and 10 deletions

View file

@ -7,7 +7,7 @@ generate_interface() {
} }
generate_access_control() { generate_access_control() {
echo "$ACCESS_CONTROLS" | while read entry; do echo "$ACCESS_CONTROLS" | while read -r entry; do
echo " access-control: $entry" echo " access-control: $entry"
done done
} }
@ -983,12 +983,12 @@ $(generate_forward_addr)
# 1. the keys/certs cannot be produced by unbound. You can use dnscrypt-wrapper # 1. the keys/certs cannot be produced by unbound. You can use dnscrypt-wrapper
# for this: https://github.com/cofyc/dnscrypt-wrapper/blob/master/README.md#usage # for this: https://github.com/cofyc/dnscrypt-wrapper/blob/master/README.md#usage
# 2. dnscrypt channel attaches to an interface. you MUST set interfaces to # 2. dnscrypt channel attaches to an interface. you MUST set interfaces to
# listen on `dnscrypt-port` with the follo0wing snippet: # listen on 'dnscrypt-port' with the follo0wing snippet:
# server: # server:
# interface: 0.0.0.0@443 # interface: 0.0.0.0@443
# interface: ::0@443 # interface: ::0@443
# #
# Finally, `dnscrypt` config has its own section. # Finally, 'dnscrypt' config has its own section.
# dnscrypt: # dnscrypt:
# dnscrypt-enable: yes # dnscrypt-enable: yes
# dnscrypt-port: 443 # dnscrypt-port: 443

View file

@ -33,16 +33,20 @@ case "$os" in
esac esac
# Required parameters: # Required parameters:
export DNS64_PREFIX=$(cat "$__object/parameter/dns64_prefix") DNS64_PREFIX=$(cat "$__object/parameter/dns64_prefix")
export FORWARD_ADDRS=$(cat "$__object/parameter/forward_addr") export DNS64_PREFIX
FORWARD_ADDRS=$(cat "$__object/parameter/forward_addr")
export FORWARD_ADDRS
# Optional parameters: # Optional parameters:
if [ -f "$__object/parameter/interface" ]; then if [ -f "$__object/parameter/interface" ]; then
export INTERFACES=$(cat "$__object/parameter/interface") INTERFACES=$(cat "$__object/parameter/interface")
export INTERFACES
fi fi
if [ -f "$__object/parameter/access_control" ]; then if [ -f "$__object/parameter/access_control" ]; then
export ACCESS_CONTROLS=$(cat "$__object/parameter/access_control") ACCESS_CONTROLS=$(cat "$__object/parameter/access_control")
export ACCESS_CONTROLS
fi fi
# Boolean parameters: # Boolean parameters:
@ -69,9 +73,9 @@ source_file="$__object/files/unbound.conf"
target_file="/etc/unbound/unbound.conf" target_file="/etc/unbound/unbound.conf"
mkdir -p "$__object/files" mkdir -p "$__object/files"
"$__type/files/unbound.conf.sh" > $source_file "$__type/files/unbound.conf.sh" > "$source_file"
require="__package/unbound" __file $target_file \ require="__package/unbound" __file "$target_file" \
--source $source_file \ --source "$source_file" \
--owner root \ --owner root \
--mode 644 --mode 644