caiwang / board2ihost

0 stars 0 forks source link

getting wlan capture source mac #78

Open unissoft-bj opened 9 years ago

unissoft-bj commented 9 years ago

if [ -f /root/ruckus ]; then

working with ruckus

# retrive ruckus ip
REMOTE_IP=`sed '1q;d' /root/ruckus`
# get 3 parts of the ip address 
#arr=($(echo $REMOTE_IP | tr '.' ' ' | tr -s ' '))
echo ${arr[0]},${arr[1]},${arr[2]}
if [  "${arr[0]}" = '192' -a  "${arr[1]}" = '168' -a "${arr[2]}" = '100' ]; then
    pingIP=$REMOTE_IP
else
    pingIP='192.168.100.100'
fi
#echo $pingIP

ping $pingIP -c1 > /dev/null
srcmac=`arp $pingIP |awk '{print $3}'|grep ":"`
echo $srcmac

else

capture on wlan1

srcmac=`ifconfig wlan1 | grep wlan1 |cut -d':' -f2-7|cut -d '' -f4 | awk '{print $3}'`
echo $srcmac

fi