diff --git a/mail-toaster.sh b/mail-toaster.sh index 2fe68da3..aa49bc21 100755 --- a/mail-toaster.sh +++ b/mail-toaster.sh @@ -475,21 +475,22 @@ get_safe_jail_path() add_jail_conf_d() { + _safe_path="/etc/jail.conf.d/$(safe_jailname $1).conf" if [ -f "/etc/jail.conf.d/$1.conf" ]; then - tell_status "preserving jail config /etc/jail.conf.d/$1.conf" + tell_status "preserving jail config $_safe_path" return fi - tell_status "creating /etc/jail.conf.d/$1.conf" + tell_status "creating $_safe_path" echo "$(jail_conf_header) -$1 {$(get_safe_jail_path $1) - mount.fstab = \"$ZFS_DATA_MNT/$1/etc/fstab\"; +$(safe_jailname $1) {$(get_safe_jail_path $1) + mount.fstab = \"\$path/etc/fstab\"; ip4.addr = $JAIL_NET_INTERFACE|${_jail_ip}; ip6.addr = $JAIL_NET_INTERFACE|$(get_jail_ip6 $1);${JAIL_CONF_EXTRA} - exec.created = \"$ZFS_DATA_MNT/$1/etc/pf.conf.d/pfrule.sh load\"; - exec.poststop = \"$ZFS_DATA_MNT/$1/etc/pf.conf.d/pfrule.sh unload\"; - }" | tee -a /etc/jail.conf.d/$1.conf + exec.created = \"\$path/etc/pf.conf.d/pfrule.sh load\"; + exec.poststop = \"\$path/etc/pf.conf.d/pfrule.sh unload\"; + }" | tee -a $_safe_path } add_automount()