cidr2ip

Small and simple program for converting a CIDR into a netmask
git clone https://noxz.tech/git/cidr2ip.git
Log | Files | README | LICENSE

commit: a2549b7d318ec4e8ae7b20fb5f6e2d13d4290c36
parent: f7cb0a3a4b9066c603f52d3cbb11056d28c1b2eb
author: z0noxz <chris@noxz.tech>
date:   Fri, 3 Aug 2018 22:10:21 +0200
fix correct exit codes
Mcidr2ip3++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cidr2ip b/cidr2ip
@@ -35,7 +35,7 @@ function cidr2ip {
 # check if input is a CIDR
 if [[ $1 =~ ^[0-9]{1,2}$ && $1 -le 32 && $1 -gt 0 ]]; then
     cidr2ip $1
-    exit
+    exit 0
 fi
 
 # if all fails print usage
@@ -49,3 +49,4 @@ $license
 EOF
 printf "%s\n\n" "$usage" >&2
 
+exit 1