ip2cidr

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

commit 04797a0345407eb4a954dbcf637bd0e7f3a0af2d
parent 33eb256fea09d4113b6b9dffa2752b6abf997324
Author: z0noxz <chris@noxz.tech>
Date:   Tue,  7 Aug 2018 08:31:33 +0200

handle "empty" ip addresses

Diffstat:
Mip2cidr | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/ip2cidr b/ip2cidr @@ -40,6 +40,10 @@ do_ip2cidr() { result=0 i=0 + if [ "$ip" = "" ]; then + return 1 + fi + IFS=\. for item in $ip; do if [ "$item" -eq "$item" ] 2> /dev/null && \