From 89cdd1c872694797a8f6f0185be2b2cd3467bfcc Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Sun, 14 Jul 2024 21:48:37 -0400 Subject: add default nameservers for jailctl --- files/usr/local/sbin/jailctl.freebsd_hypervisor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'files/usr/local/sbin/jailctl.freebsd_hypervisor') diff --git a/files/usr/local/sbin/jailctl.freebsd_hypervisor b/files/usr/local/sbin/jailctl.freebsd_hypervisor index 3698aa4..03ed563 100644 --- a/files/usr/local/sbin/jailctl.freebsd_hypervisor +++ b/files/usr/local/sbin/jailctl.freebsd_hypervisor @@ -171,6 +171,8 @@ Options: : ${gateway:="${ip%.*}.1"} fi + : ${nameservers:="$DEFAULT_NAMESERVERS"} + [ $# -lt 1 ] && cmd::usage 'NAME not specified' [ $# -lt 2 ] && cmd::usage 'TEMPLATE not specified' [ $# -gt 2 ] && cmd::usage 'too many arguments' @@ -205,10 +207,8 @@ Options: cp -v /etc/localtime "${JAIL_HOME}/${name}/os/etc/localtime" # Generate /etc/resolv.conf in the jail (word-splitting intentional). - if [ -n "${nameservers:-} "]; then - printf 'nameserver %s\n' $nameservers >> "${JAIL_HOME}/${name}/os/etc/resolv.conf" - printf 'search %s\n' "${searchdomains:-$domain}" >> "${JAIL_HOME}/${name}/os/etc/resolv.conf" - fi + printf 'nameserver %s\n' $nameservers >> "${JAIL_HOME}/${name}/os/etc/resolv.conf" + printf 'search %s\n' "${searchdomains:-$domain}" >> "${JAIL_HOME}/${name}/os/etc/resolv.conf" # Get the jail's virtual interface name. local epair_name -- cgit v1.2.3