Skip to content

Instantly share code, notes, and snippets.

@somian
Created September 6, 2015 05:40
Show Gist options
  • Save somian/ef1bbd95ce1fa9a9492c to your computer and use it in GitHub Desktop.
Save somian/ef1bbd95ce1fa9a9492c to your computer and use it in GitHub Desktop.
What works for me Get IP assigned to wlan0 on LinuxMint
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