Skip to content

Commit

Permalink
Merge pull request #530 from JRGTH/clone_cmd_fixes
Browse files Browse the repository at this point in the history
Update the exec.* with uniq_epair when cloning jails
  • Loading branch information
cedwards authored Jul 18, 2022
2 parents 722adc4 + 74b6eb7 commit 260149c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions usr/local/share/bastille/clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ update_jailconf_vnet() {
if [ -n "${jail_list}" ]; then
if ! grep -q "e0b_bastille${_num}" "${bastille_jailsdir}"/*/jail.conf; then
uniq_epair="bastille${_num}"
# Update the exec.* with uniq_epair when cloning jails.
sed -i '' "s|vnet.interface = e0b_bastille.*;|vnet.interface = e0b_${uniq_epair};|" "${JAIL_CONFIG}"
sed -i '' "s|exec.prestart += \"jib addm bastille[0-9]|exec.prestart += \"jib addm ${uniq_epair}|" "${JAIL_CONFIG}"
sed -i '' "s|exec.prestart += \"ifconfig e0a_bastille[0-9].*|exec.prestart += \"ifconfig e0a_${uniq_epair} description \\\\\"vnet host interface for Bastille jail ${NEWNAME}\\\\\"\";|" "${JAIL_CONFIG}"
sed -i '' "s|exec.poststop += \"jib destroy bastille[0-9]\";|exec.poststop += \"jib destroy ${uniq_epair}\";|" "${JAIL_CONFIG}"
break
fi
fi
Expand Down

0 comments on commit 260149c

Please sign in to comment.