Skip to content

Instantly share code, notes, and snippets.

@seanli1
Last active January 23, 2021 01:06
Show Gist options
  • Save seanli1/f8475a1eae7d1f0f5b52dc35fb2763d7 to your computer and use it in GitHub Desktop.
Save seanli1/f8475a1eae7d1f0f5b52dc35fb2763d7 to your computer and use it in GitHub Desktop.
Sends the device name IP address to IFTTT webhook
#!/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