Skip to content
Snippets Groups Projects

Alfred IP Lookup

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Erick Hitter

    IP_Address_v1.2.1.alfredworkflow

    Edited
    alfred-ip.sh 751 B
    LOCAL=$(ifconfig | grep -A 1 "en" | grep broadcast | cut -d " " -f 2 | tr "\\n" " ")
    EXTERNAL=$(curl --silent http://whatismyip.akamai.com)
    EXTERNAL6=$(curl --silent http://ipv6.whatismyip.akamai.com)
    
    cat<<EOB
    <?xml version="1.0"?>
    <items>
    <item uid="externalip" arg="$EXTERNAL">
    <title>External IPv4: $EXTERNAL</title>
    <subtitle>Press Enter to paste, or Cmd+C to copy</subtitle>
    <icon>icon.png</icon>
    </item>
    <item uid="externalip6" arg="$EXTERNAL6">
    <title>External IPv6: $EXTERNAL</title>
    <subtitle>Press Enter to paste, or Cmd+C to copy</subtitle>
    <icon>icon.png</icon>
    </item>
    <item uid="localip" arg="$LOCAL">
    <title>Local IP: $LOCAL</title>
    <subtitle>Press Enter to paste, or Cmd+C to copy</subtitle>
    <icon>icon.png</icon>
    </item>
    </items>
    EOB
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment