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

Create Trigger to use macOS terminal to Ping domain

General Discussion
2
2
450
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 Aug 7, 2020, 5:05 PM

    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.

    R 1 Reply Last reply Aug 7, 2020, 7:52 PM Reply Quote 0
    • R
      Russ @kbnetguy
      last edited by Russ Aug 7, 2020, 7:53 PM Aug 7, 2020, 7:52 PM

      @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
      1 out of 2
      • First post
        1/2
        Last post