Created
September 6, 2015 05:40
-
-
Save somian/ef1bbd95ce1fa9a9492c to your computer and use it in GitHub Desktop.
What works for me Get IP assigned to wlan0 on LinuxMint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wlan_ip () { | |
# Get ip assigned to wlan0 interface if it is up. | |
nmcli --pretty con status uuid 'ac868f68-fd04-41c2-ac0e-2ff40fd71b7c' | | |
cut -d ':' -f2 | | |
awk '/ip_address/{print $3}' |tee /tmp/w0ip | |
} | |
NetWhere () { | |
case "$(nmcli --terse --fields device,state dev status|grep --color=never wlan0)" in | |
( wlan0:connected ) Wlan_ip | |
;; | |
( wlan0:* ) : | |
;; | |
( * ) : | |
;; | |
esac | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment