i got a nasty isue here.
for my machine i want to make a checkup script to see to what wireless network i am connected to.
if i type iwconfig i get below output.
Code:
iwconfig
wlan0 IEEE 802.11bgn ESSID:"APqwerty"
Mode:Managed Frequency:2.447 GHz Access Point: 72:6B:D3:36:29:44
Bit Rate=54 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=55/70 Signal level=-55 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:7339 Invalid misc:83573 Missed beacon:0
lo no wireless extensions.
eth0 no wireless extensions.
With a grep awk combo i manage to narow it down.
Code:
iwconfig | grep ESSID |awk '{ /ESSID/; print $4 }'
lo no wireless extensions.
eth0 no wireless extensions.
ESSID:"APqwerty"
why it also shows lo and eth0 ,i dont know, but ok.
i tried several combo's on grep, awk, even cut.
i only want to catch the ESSID to where i am connected to, in this case APqwerty.
i know i am missing something, but cant find out what it is, any advice ?