summaryrefslogtreecommitdiff
path: root/src/validators/ip-cidr
diff options
context:
space:
mode:
Diffstat (limited to 'src/validators/ip-cidr')
-rw-r--r--src/validators/ip-cidr10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/validators/ip-cidr b/src/validators/ip-cidr
new file mode 100644
index 0000000..60d2ac2
--- /dev/null
+++ b/src/validators/ip-cidr
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+ipaddrcheck --is-any-cidr $1
+
+if [ $? -gt 0 ]; then
+ echo "Error: $1 is not a valid IP CIDR"
+ exit 1
+fi
+
+exit 0 \ No newline at end of file