11 lines
326 B
Bash
Executable File
11 lines
326 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
|
|
# ERRORS:
|
|
# 3: Bad usage
|
|
|
|
[ ${#} -eq 1 ] || exit 3
|
|
<<<"${1}" awk -F. '{print $4"."$3"." $2"."$1}' | sed 's/$/.in-addr.arpa/'
|