aboutsummaryrefslogtreecommitdiff
path: root/files/usr/local/sbin/jailctl.freebsd_hypervisor
diff options
context:
space:
mode:
authorCullum Smith <cullum@sacredheartsc.com>2024-07-14 21:48:37 -0400
committerCullum Smith <cullum@sacredheartsc.com>2024-07-14 21:48:37 -0400
commit89cdd1c872694797a8f6f0185be2b2cd3467bfcc (patch)
treeb62d710a7ac7edb210b7a72be7582d8579e469b9 /files/usr/local/sbin/jailctl.freebsd_hypervisor
parent6febd59c9a36f6f35057a6c80d59825d92c7377d (diff)
downloadinfrastructure-89cdd1c872694797a8f6f0185be2b2cd3467bfcc.tar.gz
add default nameservers for jailctl
Diffstat (limited to 'files/usr/local/sbin/jailctl.freebsd_hypervisor')
-rw-r--r--files/usr/local/sbin/jailctl.freebsd_hypervisor8
1 files changed, 4 insertions, 4 deletions
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