Skip to content

Commit

Permalink
Merge pull request #302 from cedwards/vnet-checks
Browse files Browse the repository at this point in the history
adding a couple vnet exceptions for ip4.addr checks
  • Loading branch information
cedwards authored Jan 1, 2021
2 parents 4136f8f + 83a83e0 commit c9b02fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 5 additions & 3 deletions usr/local/share/bastille/rdr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ if [ -z "${JAIL_NAME}" ]; then
fi

# Check jail ip4 address valid
JAIL_IP=$(jls -j "${TARGET}" ip4.addr 2>/dev/null)
if [ -z "${JAIL_IP}" -o "${JAIL_IP}" = "-" ]; then
error_exit "Jail IP not found: ${TARGET}"
if [ "$(bastille config $TARGET get vnet)" != 'enabled' ]; then
JAIL_IP=$(jls -j "${TARGET}" ip4.addr 2>/dev/null)
if [ -z "${JAIL_IP}" -o "${JAIL_IP}" = "-" ]; then
error_exit "Jail IP not found: ${TARGET}"
fi
fi

# Check rdr-anchor is setup in pf.conf
Expand Down
10 changes: 6 additions & 4 deletions usr/local/share/bastille/template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,12 @@ for _jail in ${JAILS}; do

## jail-specific variables.
bastille_jail_path=$(jls -j "${_jail}" path)
_jail_ip=$(jls -j "${_jail}" ip4.addr 2>/dev/null)
if [ -z "${_jail_ip}" -o "${_jail_ip}" = "-" ]; then
error_notify "Jail IP not found: ${_jail}"
_jail_ip='' # In case it was -. -- cwells
if [ "$(bastille config $TARGET get vnet)" != 'enabled' ]; then
_jail_ip=$(jls -j "${_jail}" ip4.addr 2>/dev/null)
if [ -z "${_jail_ip}" -o "${_jail_ip}" = "-" ]; then
error_notify "Jail IP not found: ${_jail}"
_jail_ip='' # In case it was -. -- cwells
fi
fi

## TARGET
Expand Down

0 comments on commit c9b02fa

Please sign in to comment.