Use yes rather than random text.
[openresolv] / unbound.in
index 4ee0da7202633fac6d14dfa697495c648c274bab..124cecf624edba1c426ded73851dde7421d5a085 100644 (file)
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+unbound_insecure=
+
 [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0
 . "@SYSCONFDIR@/resolvconf.conf" || exit 1
 [ -z "$unbound_conf" ] && exit 0
-[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)"
+[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)"
 NL="
 "
 
@@ -41,6 +43,11 @@ newconf="# Generated by resolvconf$NL"
 for d in $DOMAINS; do
        dn="${d%%:*}"
        ns="${d#*:}"
+       case "$unbound_insecure" in
+       [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+               newconf="$newconf${NL}domain-insecure: \"$dn\""
+               ;;
+       esac
        newconf="$newconf${NL}forward-zone:$NL  name: \"$dn\"$NL"
        while [ -n "$ns" ]; do
                newconf="$newconf       forward-addr: ${ns%%,*}$NL"
@@ -60,7 +67,7 @@ fi
 if type config_mkdirs >/dev/null 2>&1; then
        config_mkdirs "$unbound_conf"
 else
-       @PREFIX@/sbin/resolvconf -D "$unbound_conf"
+       @SBINDIR@/resolvconf -D "$unbound_conf"
 fi
 
 if [ ! -f "$unbound_conf" ] || \