Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for subnet in 90 70 71 10 20 30 60 91
- do
- case $subnet in
- 90)
- iface="eth25";
- ;;
- 70)
- iface="eth23";
- ;;
- 71)
- iface="eth20";
- ;;
- 10)
- iface="eth26";
- ;;
- 20)
- iface="eth27";
- ;;
- 30)
- iface="eth28";
- ;;
- 60)
- iface="eth21";
- ;;
- 91)
- iface="eth24";
- ;;
- esac
- arp-scan --interface $iface 192.168.$subnet.0/24 | awk '{print $1" "$2}' | grep 192 > /tmp/ipscan.tmp
- exec 3</tmp/ipscan.tmp
- while read -u 3 name; do
- ip=`echo $name| awk '{print $1}'`;
- mac=`echo $name| awk '{print $2}'`;
- nbname=`wbinfo -I $ip| awk '{print $2}'`;
- /home/ipscan/bin/logwrite.pl "$ip" "$mac" "$nbname";
- done
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement