From 3d3a3ef8024a5dc201253bfa5a67b1508510e0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Wed, 3 Jun 2020 15:08:04 +0200 Subject: [PATCH] Fix shellcheck warnings in newly imported __unbound type --- type/__unbound/files/unbound.conf.sh | 6 +++--- type/__unbound/manifest | 18 +++++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/type/__unbound/files/unbound.conf.sh b/type/__unbound/files/unbound.conf.sh index e713843..effea65 100755 --- a/type/__unbound/files/unbound.conf.sh +++ b/type/__unbound/files/unbound.conf.sh @@ -7,7 +7,7 @@ generate_interface() { } generate_access_control() { - echo "$ACCESS_CONTROLS" | while read entry; do + echo "$ACCESS_CONTROLS" | while read -r entry; do echo " access-control: $entry" done } @@ -983,12 +983,12 @@ $(generate_forward_addr) # 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 # 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: # interface: 0.0.0.0@443 # interface: ::0@443 # -# Finally, `dnscrypt` config has its own section. +# Finally, 'dnscrypt' config has its own section. # dnscrypt: # dnscrypt-enable: yes # dnscrypt-port: 443 diff --git a/type/__unbound/manifest b/type/__unbound/manifest index 525a981..a25cdec 100755 --- a/type/__unbound/manifest +++ b/type/__unbound/manifest @@ -33,16 +33,20 @@ case "$os" in esac # Required parameters: -export DNS64_PREFIX=$(cat "$__object/parameter/dns64_prefix") -export FORWARD_ADDRS=$(cat "$__object/parameter/forward_addr") +DNS64_PREFIX=$(cat "$__object/parameter/dns64_prefix") +export DNS64_PREFIX +FORWARD_ADDRS=$(cat "$__object/parameter/forward_addr") +export FORWARD_ADDRS # Optional parameters: if [ -f "$__object/parameter/interface" ]; then - export INTERFACES=$(cat "$__object/parameter/interface") + INTERFACES=$(cat "$__object/parameter/interface") + export INTERFACES fi 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 # Boolean parameters: @@ -69,9 +73,9 @@ source_file="$__object/files/unbound.conf" target_file="/etc/unbound/unbound.conf" mkdir -p "$__object/files" -"$__type/files/unbound.conf.sh" > $source_file -require="__package/unbound" __file $target_file \ - --source $source_file \ +"$__type/files/unbound.conf.sh" > "$source_file" +require="__package/unbound" __file "$target_file" \ + --source "$source_file" \ --owner root \ --mode 644