Compare commits

...

3 Commits

Author SHA1 Message Date
Barry McCormick
0065a6b9f0 slash check added 2023-10-17 12:35:25 -07:00
Barry McCormick
10949c0eeb netmask checking for jail ip 2023-10-17 08:52:32 -07:00
Barry McCormick
3355c07dbf rdr disable directive fix 2023-10-04 10:13:08 -07:00
2 changed files with 10 additions and 1 deletions

View File

@@ -82,6 +82,15 @@ validate_ip() {
else
local IFS
if echo "${ip}" | grep -Eq '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))?$'; then
CHARACTER="/"
TEST_SLASH=$(echo "${ip}"
if echo $TEST_SLASH | grep -q "$CHARACTER"
else
exit 1
TEST_MASK=$(echo "${ip}" | cut -d / -f2)
if TEST_MASK=""
echo "missing netmask"
exit 1
TEST_IP=$(echo "${ip}" | cut -d / -f1)
IFS=.
set ${TEST_IP}

View File

@@ -76,7 +76,7 @@ check_jail_validity() {
fi
# Check if jail ip6 address (ip6.addr) is valid (non-VNET only)
if [ "$(bastille config $TARGET get vnet)" != 'enabled' ]; then
if [ "$(bastille config $TARGET get ip6)" != 'disabled' ] && [ "$(bastille config $TARGET get ip6)" != 'not set' ]; then
if [ "$(bastille config $TARGET get ip6)" != 'disable' ] && [ "$(bastille config $TARGET get ip6)" != 'not set' ]; then
JAIL_IP6=$(/usr/sbin/jls -j "${TARGET}" ip6.addr 2>/dev/null)
fi
fi