Improve wireless detection when interface is down
This commit is contained in:
parent
efe6ff2220
commit
131bcdae10
1 changed files with 3 additions and 2 deletions
|
@ -7,8 +7,9 @@ get_ssid()
|
|||
# Check OS
|
||||
case $(uname -s) in
|
||||
Linux)
|
||||
if iw dev | grep ssid | cut -d ' ' -f 2 &> /dev/null; then
|
||||
echo "$(iw dev | grep ssid | cut -d ' ' -f 2)"
|
||||
SSID=$(iw dev | sed -nr 's/^\t\tssid (.*)/\1/p')
|
||||
if [ -n "$SSID" ]; then
|
||||
echo -- "$SSID"
|
||||
else
|
||||
echo 'Ethernet'
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue