Create Trigger to use macOS terminal to Ping domain
-
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.
-
@kbnetguy, this command should work on a Mac:
dig +short www.triggercmd.com | tail -n1I 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 $IPIf you must use ping, let me know. I had that command figured out for Linux, but Mac's ping and grep are different.
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