Merge pull request #200 from cedwards/0_6_fixes
fix route auto-detect and SERVICE template
This commit is contained in:
@@ -331,13 +331,13 @@ create_jail() {
|
|||||||
## if 0.0.0.0 set DHCP
|
## if 0.0.0.0 set DHCP
|
||||||
## else set static address
|
## else set static address
|
||||||
if [ "${IP}" == "0.0.0.0" ]; then
|
if [ "${IP}" == "0.0.0.0" ]; then
|
||||||
/usr/sbin/sysrc -f "${bastille_jail_rc_conf}" ifconfig_vnet0="DHCP"
|
/usr/sbin/sysrc -f "${bastille_jail_rc_conf}" ifconfig_vnet0="SYNCDHCP"
|
||||||
else
|
else
|
||||||
/usr/sbin/sysrc -f "${bastille_jail_rc_conf}" ifconfig_vnet0="inet ${IP}"
|
/usr/sbin/sysrc -f "${bastille_jail_rc_conf}" ifconfig_vnet0="inet ${IP}"
|
||||||
if [ -n "${bastille_network_gateway}" ]; then
|
if [ -n "${bastille_network_gateway}" ]; then
|
||||||
/usr/sbin/sysrc -f "${bastille_jail_rc_conf}" defaultrouter="${bastille_network_gateway}"
|
/usr/sbin/sysrc -f "${bastille_jail_rc_conf}" defaultrouter="${bastille_network_gateway}"
|
||||||
else
|
else
|
||||||
/usr/sbin/sysrc -f "${bastille_jail_rc_conf}" defaultrouter="$(route show default | awk '/gateway/ {print $2}')"
|
/usr/sbin/sysrc -f "${bastille_jail_rc_conf}" defaultrouter="$(netstat -rn | awk '/default/ {print $2}')"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ for _jail in ${JAILS}; do
|
|||||||
if [ -s "${bastille_template}/SERVICE" ]; then
|
if [ -s "${bastille_template}/SERVICE" ]; then
|
||||||
echo -e "${COLOR_GREEN}[${_jail}]:SERVICE -- START${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}[${_jail}]:SERVICE -- START${COLOR_RESET}"
|
||||||
while read _service; do
|
while read _service; do
|
||||||
jexec -l "${_jail}" /usr/sbin/service "${_service}" || exit 1
|
jexec -l "${_jail}" /usr/sbin/service ${_service} || exit 1
|
||||||
done < "${bastille_template}/SERVICE"
|
done < "${bastille_template}/SERVICE"
|
||||||
echo -e "${COLOR_GREEN}[${_jail}]:SERVICE -- END${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}[${_jail}]:SERVICE -- END${COLOR_RESET}"
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user