TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Create Trigger to use macOS terminal to Ping domain

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 988 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K Offline
      kbnetguy
      last edited by

      Sorry, I think I may have posted this request twice:

      Very New. Was wondering how to create a trigger to do the following on my macOS

      Run a ping request in terminal
      2)Return results for one value -
      For example, if I ping a domain name I want the value coming back with the FROM IP address.

      My goal is to get the returned IP address from the domain name as a value so that I can use the local trigger in Microsoft Azure Logic Apps action TRIGGER CMD.

      RussR 1 Reply Last reply Reply Quote 0
      • RussR Offline
        Russ @kbnetguy
        last edited by Russ

        @kbnetguy, this command should work on a Mac:

        dig +short www.triggercmd.com | tail -n1
        

        I included the tail -n1 to use only the first line in case the host name returns multiple IP's.

        You probably know this, but to assign the result to an environment variable you can do this:

        export IP=$(dig +short www.triggercmd.com | tail -n1)
        echo $IP
        

        If you must use ping, let me know. I had that command figured out for Linux, but Mac's ping and grep are different.

        Russell VanderMey

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post