2014-01-04 14:45:55 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if ! command -v nmap >/dev/null 2>&1; then
|
2014-11-12 16:15:39 +01:00
|
|
|
echo >&2 "'nmap' not found in PATH. Exiting."
|
|
|
|
exit 1
|
2014-01-04 14:45:55 +01:00
|
|
|
fi
|
|
|
|
|
2015-07-10 13:36:27 +02:00
|
|
|
SUBNET="$(ifconfig | awk '/inet / && $0 !~ "127.0.0.1" {gsub(/\.[0-9]+$/, ".*", $2) ; print $2}')"
|
2014-01-04 14:45:55 +01:00
|
|
|
echo "Scanning '$SUBNET'..."
|
|
|
|
nmap -sP "$SUBNET"
|