mirror of
https://github.com/m8tin/cis.git
synced 2026-11-02 14:17:24 +01:00
using host and added testified
This commit is contained in:
2 files changed
+48
-9
No files matched your search
@@ -45,15 +45,30 @@ function published() {
|
||||
_BOOT_HOSTNAME="$(hostname -b)"
|
||||
readonly _BOOT_HOSTNAME
|
||||
|
||||
nslookup -type=AAAA "${_BOOT_HOSTNAME:?"Missing BOOT_HOSTNAME"}" | xargs -n 1 \
|
||||
| grep -A2 -i "${_BOOT_HOSTNAME}" \
|
||||
| grep -A1 -i address \
|
||||
host -t aaaa "${_BOOT_HOSTNAME:?"Missing BOOT_HOSTNAME"}" | xargs -n 1 \
|
||||
| grep -A4 -i "${_BOOT_HOSTNAME}" \
|
||||
| grep -A3 -i 'has' \
|
||||
| grep -A2 -i 'IPv6' \
|
||||
| grep -A1 -i 'address' \
|
||||
| tail -n1
|
||||
}
|
||||
|
||||
function testified() {
|
||||
local _BOOT_HOSTNAME
|
||||
_BOOT_HOSTNAME="$(hostname -b)"
|
||||
readonly _BOOT_HOSTNAME
|
||||
|
||||
host -t aaaa "${_BOOT_HOSTNAME:?"Missing BOOT_HOSTNAME"}" 2001:4860:4860::8888 | xargs -n 1 \
|
||||
| grep -A4 -i "${_BOOT_HOSTNAME}" \
|
||||
| grep -A3 -i 'has' \
|
||||
| grep -A2 -i 'IPv6' \
|
||||
| grep -A1 -i 'address' \
|
||||
| tail -n1
|
||||
}
|
||||
|
||||
function verified() {
|
||||
local _PUBLISHED_IP
|
||||
_PUBLISHED_IP="$(published)"
|
||||
_PUBLISHED_IP="$(testified)"
|
||||
readonly _PUBLISHED_IP
|
||||
|
||||
[ -z "${_PUBLISHED_IP}" ] \
|
||||
@@ -68,7 +83,8 @@ function usage() {
|
||||
echo " --routed : prints the IPv6 address used to send traffic to the default gateway"
|
||||
echo " --public : prints all IPv6 addresses direct accessable from the internet"
|
||||
echo " --published : prints the IPv6 address provided by DNS using this host's name"
|
||||
echo " --verified : prints the IPv6 included in 'all' und respended by 'published'"
|
||||
echo " --testified : prints the IPv4 address provided by DNS using this host's name and the external DNS server 2001:4860:4860::8888"
|
||||
echo " --verified : prints the IPv6 included in 'all' und respended by 'testified'"
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +108,10 @@ function main(){
|
||||
published
|
||||
return 0
|
||||
;;
|
||||
--testified)
|
||||
testified
|
||||
return 0
|
||||
;;
|
||||
--verified)
|
||||
verified
|
||||
return 0
|
||||
|
||||
Reference in new issue
Block a user