add support for linux network
This commit is contained in:
parent
3089559638
commit
b3614321da
1 changed files with 26 additions and 5 deletions
|
@ -7,11 +7,32 @@
|
||||||
|
|
||||||
get_ssid()
|
get_ssid()
|
||||||
{
|
{
|
||||||
if /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2 &> /dev/null; then
|
# Check OS
|
||||||
echo "$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2)"
|
case $(uname -s) in
|
||||||
else
|
Linux)
|
||||||
echo ' Ethernet'
|
if iw dev | grep ssid | cut -d ' ' -f 2 &> /dev/null; then
|
||||||
fi
|
echo $(iw dev | grep ssid | cut -d ' ' -f 2)
|
||||||
|
else
|
||||||
|
echo ' Ethernet'
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
Darwin)
|
||||||
|
if /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2 &> /dev/null; then
|
||||||
|
echo "$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2)"
|
||||||
|
else
|
||||||
|
echo ' Ethernet'
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
CYGWIN*|MINGW32*|MSYS*|MINGW*)
|
||||||
|
# leaving empty - TODO - windows compatability
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in a new issue