diff options
Diffstat (limited to 'src/validators')
-rwxr-xr-x | src/validators/ipv6-srv6-segments | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/validators/ipv6-srv6-segments b/src/validators/ipv6-srv6-segments new file mode 100755 index 000000000..e72a4f90f --- /dev/null +++ b/src/validators/ipv6-srv6-segments @@ -0,0 +1,13 @@ +#!/bin/sh +segments="$1" +export IFS="/" + +for ipv6addr in $segments; do + ipaddrcheck --is-ipv6-single $ipv6addr + if [ $? -gt 0 ]; then + echo "Error: $1 is not a valid IPv6 address" + exit 1 + fi +done +exit 0 + |