From 10949c0eeb177d60742f5f50d2d702e71243d7c0 Mon Sep 17 00:00:00 2001 From: Barry McCormick Date: Tue, 17 Oct 2023 08:52:32 -0700 Subject: [PATCH] netmask checking for jail ip --- usr/local/share/bastille/create.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 80f7038..e7dd188 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -82,6 +82,10 @@ 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 + 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}