2022-08-29 01:04:37 -06:00
|
|
|
#!/bin/bash
|
|
|
|
# FILE: wgapi:back/lib/ns/update/rev_ipv6
|
|
|
|
# DESCRIPTION: Returns the rDNS reversed version of an IPv6 address
|
|
|
|
# USAGE: rev_ipv6 ...
|
|
|
|
# OUTPUT: ...ip6.arpa
|
2022-09-08 21:15:30 -06:00
|
|
|
# ERRORS:
|
|
|
|
# 3: Bad usage
|
2022-09-10 10:24:11 -06:00
|
|
|
# 4: Calculation failed
|
2022-08-29 01:04:37 -06:00
|
|
|
|
2022-09-10 09:59:27 -06:00
|
|
|
# TODO: Do this in bash or whatever and remove the ipv6calc from dependencies
|
2022-09-08 21:15:30 -06:00
|
|
|
[ ${#} -eq 1 ] || exit 3
|
2022-09-10 10:24:11 -06:00
|
|
|
ipv6calc --out 'revnibbles.arpa' --in 'ipv6addr' "${1}" || exit 4
|