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