dlacaille Posted July 22, 2014 Share Posted July 22, 2014 (edited) First workflow, and first upload. There are no external requirements. Simple script is included. This should print (in Large type window) your current IP addresses on "normal" interfaces, or it will say 'down' or 'invalid'. Improvements certainly welcome! Launch by typing "ipstat" into Alfred. I created this so I could quickly see my IP addresses from anywhere in OS X without using the mouse. Download here Edited July 22, 2014 by dlacaille Link to comment
scottfwalter Posted July 24, 2014 Share Posted July 24, 2014 (edited) Thanks for this workflow I modified it a bit: 1. One of my ethernet addresses did not start with a number so your grep was removing it. 2. I added the name of the device next to the 3. Removed displaying interfaces that do not have an ip address 4. Added displaying the public facing ip address INTERFACES=$(networksetup -listallhardwareports | grep -B 2 "Ethernet Address: [a-f]*" | grep -v -E '(Ethernet|\-\-)' | cut -d":" -f2 | paste -s -d" " -) # Parse through interfaces for interface in $INTERFACES do CMD_OUT=$(ifconfig $interface inet 2>&1 | grep -v -E '(option|flags)' | cut -d" " -f2) if [ -z $CMD_OUT ]; then error="" else if [ $CMD_OUT = "interface" ]; then error="" else echo "$(networksetup -listallhardwareports | grep -B 1 "Device: $interface" | grep "Hardware Port" | cut -d":" -f2) ($interface) $CMD_OUT" fi fi done echo " Public Facing $(dig +short myip.opendns.com @resolver1.opendns.com)" Edited July 24, 2014 by scottfwalter Link to comment
dlacaille Posted July 25, 2014 Author Share Posted July 25, 2014 That is *SO* much nicer, thanks Scott! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now