Last active
January 23, 2021 01:06
-
-
Save seanli1/f8475a1eae7d1f0f5b52dc35fb2763d7 to your computer and use it in GitHub Desktop.
Sends the device name IP address to IFTTT webhook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This app sends the device name IP address to IFTTT webhook | |
# Run this regularly by adding to the chronos table. In Terminal: | |
# `crontab - e` | |
# Add to list. I.e. if you want to run monthly: | |
# `@monthly bash send_ip.sh` | |
# device_name=new_device | |
device_name=$HOSTNAME | |
ip=`curl -s https://api.ipify.org` | |
url="https://maker.ifttt.com/trigger/send_ip/with/key/[WEBHOOK-KEY]?value1=$device_name&value2=$ip" | |
curl $url | |
echo ": $ip" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment