LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 02-22-2016, 10:12 AM   #1
RogueWarrior65
Member
 
Registered: Aug 2010
Posts: 48

Rep: Reputation: 0
How to find out when wifi is connected?


Is there a way to find out from within a shell script when the wifi connection to a DHCP router has been established? Here's the scenario: on a Yocto-based embedded machine, it takes about 15 seconds after the login prompt appears on the console before the systemd invoked wpa supplicant stuff finally establishes the connection. I'm going to be running a program that needs wlan0 to have a valid IP address as opposed to eth0. I don't want to launch the program until the wifi is connected. So is there something I can poll from a shell script to check that wlan0 has an ip address?
 
Old 02-22-2016, 10:56 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,366

Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
How about
Code:
iwconfig |grep your_essid
That should do it. Doubtless there are more subtle ways.
 
Old 02-27-2016, 04:45 PM   #3
RogueWarrior65
Member
 
Registered: Aug 2010
Posts: 48

Original Poster
Rep: Reputation: 0
I ended up checking ifconfig on wlan0 for an IP address since this is a DHCP setup. It works quite well.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
network manager shows connected to wifi but ifconfig show connected to ethernet mia_tech Linux - General 10 12-16-2015 10:23 AM
Want to share my wifi by creating a wifi hotspot ( While staying connected to wifi)? shadyXV Linux - Desktop 4 07-20-2015 05:37 PM
How to make torrent use wifi when connected to LAN & WIFI priyankgupta1984 Linux - Newbie 3 08-25-2014 04:25 PM
To get connected to WIFI odiliko Linux - Newbie 3 07-10-2014 06:37 PM
Wifi is not connected vigneshwaran05 Ubuntu 7 06-20-2010 04:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 07:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration