aboutsummaryrefslogtreecommitdiff
path: root/test_cidrchk.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test_cidrchk.sh')
-rwxr-xr-xtest_cidrchk.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/test_cidrchk.sh b/test_cidrchk.sh
new file mode 100755
index 0000000..cc3fe4b
--- /dev/null
+++ b/test_cidrchk.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+program=./cidrchk
+args="$@"
+
+if [ -z "$args" ]; then
+ echo "No CIDR range(s) defined"
+ exit 1
+fi
+
+$program $args
+retval=$?
+
+case "$retval" in
+ 0)
+ echo "On net"
+ ;;
+ 1)
+ echo "Off net"
+ ;;
+ 2)
+ echo "Module import failure detected"
+ ;;
+ 3)
+ echo "No network interfaces detected"
+ ;;
+ *)
+ echo "Unknown failure"
+ ;;
+esac