Validate jib during jail import
This commit is contained in:
@@ -152,6 +152,11 @@ update_jailconf() {
|
|||||||
sed -i '' "s|path.*=.*;|path = ${bastille_jailsdir}/${TARGET_TRIM}/root;|" "${JAIL_CONFIG}"
|
sed -i '' "s|path.*=.*;|path = ${bastille_jailsdir}/${TARGET_TRIM}/root;|" "${JAIL_CONFIG}"
|
||||||
sed -i '' "s|mount.fstab.*=.*;|mount.fstab = ${bastille_jailsdir}/${TARGET_TRIM}/fstab;|" "${JAIL_CONFIG}"
|
sed -i '' "s|mount.fstab.*=.*;|mount.fstab = ${bastille_jailsdir}/${TARGET_TRIM}/fstab;|" "${JAIL_CONFIG}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check for the jib script
|
||||||
|
if grep -qw "vnet" "${JAIL_CONFIG}"; then
|
||||||
|
vnet_requirements
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,6 +214,7 @@ generate_config() {
|
|||||||
# See if we need to generate a vnet network section
|
# See if we need to generate a vnet network section
|
||||||
if [ "${IS_VNET_JAIL:-0}" = "1" ]; then
|
if [ "${IS_VNET_JAIL:-0}" = "1" ]; then
|
||||||
NETBLOCK=$(generate_vnet_jail_netblock "${TARGET_TRIM}" "" "${VNET_DEFAULT_INTERFACE}")
|
NETBLOCK=$(generate_vnet_jail_netblock "${TARGET_TRIM}" "" "${VNET_DEFAULT_INTERFACE}")
|
||||||
|
vnet_requirements
|
||||||
else
|
else
|
||||||
# If there are multiple IP/NIC let the user configure network
|
# If there are multiple IP/NIC let the user configure network
|
||||||
if [ -n "${IPV4_CONFIG}" ]; then
|
if [ -n "${IPV4_CONFIG}" ]; then
|
||||||
@@ -335,6 +341,17 @@ workout_components() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vnet_requirements() {
|
||||||
|
# VNET jib script requirement
|
||||||
|
if [ ! "$(command -v jib)" ]; then
|
||||||
|
if [ -f "/usr/share/examples/jails/jib" ] && [ ! -f "/usr/local/bin/jib" ]; then
|
||||||
|
install -m 0544 /usr/share/examples/jails/jib /usr/local/bin/jib
|
||||||
|
else
|
||||||
|
warn "Warning: Unable to locate/install jib script required by VNET jails."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
config_netif() {
|
config_netif() {
|
||||||
# Get interface from bastille configuration
|
# Get interface from bastille configuration
|
||||||
if [ -n "${bastille_network_loopback}" ]; then
|
if [ -n "${bastille_network_loopback}" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user