summaryrefslogtreecommitdiff
path: root/scripts/cidr2hex
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cidr2hex')
-rwxr-xr-xscripts/cidr2hex4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/cidr2hex b/scripts/cidr2hex
index 36974e0..7a84522 100755
--- a/scripts/cidr2hex
+++ b/scripts/cidr2hex
@@ -4,4 +4,6 @@ if [ x"$1" = x ]; then
echo "Usage: $0 <cidr>" >&2; exit 255
fi
-./scripts/ip2hex "$(./scripts/cidr2ip "$1")"
+dn=$(dirname "$0")
+ip=$("$dn"/cidr2ip "$1") || exit 1
+"$dn"/ip2hex "$ip"