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

    Create Trigger to use macOS terminal to Ping domain

    General Discussion
    2
    2
    384
    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
      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
        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
        • First post
          Last post