[New Script]: nmip.sh: Runs the nmap command that shows local device ip addresses
This commit is contained in:
parent
5ece1bfc1f
commit
e6a28a23eb
26
nmip.sh
Executable file
26
nmip.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
lanip=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
|
||||||
|
|
||||||
|
# Colors
|
||||||
|
RED='\033[0;31m'
|
||||||
|
LRED="\033[1;31m"
|
||||||
|
BLUE="\033[0;34m"
|
||||||
|
LBLUE="\033[1;34m"
|
||||||
|
GREEN="\033[0;32m"
|
||||||
|
LGREEN="\033[1;32m"
|
||||||
|
YELLOW="\033[1;33m"
|
||||||
|
CYAN="\033[0;36m"
|
||||||
|
LCYAN="\033[1;36m"
|
||||||
|
PURPLE="\033[0;35m"
|
||||||
|
LPURPLE="\033[1;35m"
|
||||||
|
BWHITE="\e[1m"
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
if [ ! -f /usr/bin/nmap ];then
|
||||||
|
printf "${LRED} Nmap is not installed...${NC}\n"
|
||||||
|
else
|
||||||
|
|
||||||
|
printf "${LGREEN}Looking up ${lanip}...${NC}\n"
|
||||||
|
nmap -sP ${lanip}/24 # Use sudo to get names of devies
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user