Cheat Sheets

Network - Primary Net

Description

Inventory only scanner determining the network the FQDN resolves to

Check Script: network-primary-net.sh

#!/bin/bash

ip=$(/usr/bin/getent hosts $(/bin/hostname -f)) ip=${ip/ */}

if [ "$ip" != "" ]; then net=$(/bin/ip route | grep $ip) result_inventory "Primary Net" ${net/ */} fi
Comment on Disqus