mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-20 17:20:12 +01:00
@@ -62,6 +62,7 @@ validate_ip() {
|
||||
echo -e "${COLOR_YELLOW}Warning: ip address already in use ($ip).${COLOR_RESET}"
|
||||
else
|
||||
echo -e "${COLOR_GREEN}Valid: ($ip).${COLOR_RESET}"
|
||||
fi
|
||||
else
|
||||
echo -e "${COLOR_RED}Invalid: ($ip).${COLOR_RESET}"
|
||||
exit 1
|
||||
|
||||
@@ -64,13 +64,17 @@ for _jail in ${JAILS}; do
|
||||
|
||||
## test if not running
|
||||
elif [ ! "$(jls name | awk "/^${_jail}$/")" ]; then
|
||||
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
|
||||
jail -f "${bastille_jailsdir}/${_jail}/jail.conf" -c ${_jail}
|
||||
## warn if matching configured (but not online) ip4.addr
|
||||
ip=$(grep 'ip4.addr' "${bastille_jailsdir}/${_jail}/jail.conf" | awk '{print $3}' | sed 's/\;//g')
|
||||
if ifconfig | grep -w "$ip" >/dev/null; then
|
||||
echo -e "${COLOR_RED}Error: IP address ($ip) already in use.${COLOR_RESET}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
## start the container
|
||||
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
|
||||
jail -f "${bastille_jailsdir}/${_jail}/jail.conf" -c ${_jail}
|
||||
|
||||
## add rctl limits
|
||||
if [ -s "${bastille_jailsdir}/${_jail}/rctl.conf" ]; then
|
||||
while read _limits; do
|
||||
|
||||
Reference in New Issue
Block a user