mirror of
https://github.com/hackacad/bastille.git
synced 2026-01-04 03:33:41 +01:00
network: Add check for VLAN already added
This commit is contained in:
@@ -432,7 +432,7 @@ case "${ACTION}" in
|
||||
else
|
||||
validate_ip "${IP}"
|
||||
fi
|
||||
if [ "${VNET_JAIL}" -eq 1 ]; then
|
||||
if [ "${VNET_JAIL}" -eq 1 ] && [ -n "${VLAN_ID}" ]; then
|
||||
if ifconfig -g bridge | grep -owq "${INTERFACE}"; then
|
||||
error_exit "\"${INTERFACE}\" is a bridge interface."
|
||||
else
|
||||
@@ -441,7 +441,7 @@ case "${ACTION}" in
|
||||
bastille start "${TARGET}"
|
||||
fi
|
||||
fi
|
||||
elif [ "${BRIDGE_VNET_JAIL}" -eq 1 ]; then
|
||||
elif [ "${BRIDGE_VNET_JAIL}" -eq 1 ] && [ -n "${VLAN_ID}" ]; then
|
||||
if ! ifconfig -g bridge | grep -owq "${INTERFACE}"; then
|
||||
error_exit "\"${INTERFACE}\" is not a bridge interface."
|
||||
else
|
||||
@@ -459,6 +459,11 @@ case "${ACTION}" in
|
||||
bastille start "${TARGET}"
|
||||
fi
|
||||
fi
|
||||
elif { [ "${VNET_JAIL}" -eq 1 ] && [ -n "${VLAN_ID}" ]; } || \
|
||||
{ [ "${BRIDGE_VNET_JAIL}" -eq 1 ] && [ -n "${VLAN_ID}" ]; } then
|
||||
if grep -Eq "ifconfig_vnet[0-9]+_${VLAN_ID}" "${bastille_jailsdir}/${TARGET}/root/etc/rc.conf"; then
|
||||
error_exit "VLAN has already been added: VLAN ${VLAN_ID}"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
remove|delete)
|
||||
|
||||
Reference in New Issue
Block a user