9 lines
304 B
Bash
Executable File
9 lines
304 B
Bash
Executable File
#!/bin/bash
|
|
# FILE: wgapi:back/lib/ns/update/rev_ipv4
|
|
# DESCRIPTION: Returns the rDNS reversed version of an IPv4 address
|
|
# USAGE: rev_ipv4 10.2.0.1
|
|
# OUTPUT: 1.0.2.10.in-addr.arpa
|
|
|
|
[ "$#" == "1" ] || exit
|
|
printf "${1}" | awk -F. '{print $4"."$3"." $2"."$1}' | sed 's/$/.in-addr.arpa/'
|