Skip to content

Instantly share code, notes, and snippets.

@omar-yassin
Last active December 17, 2015 10:19
Show Gist options
  • Save omar-yassin/5593862 to your computer and use it in GitHub Desktop.
Save omar-yassin/5593862 to your computer and use it in GitHub Desktop.
Bash/Pushover script to notify current server's WAN ip address
#!/bin/bash
#https://pushover.net/ - try it!
server_hostname="something"
ip="`curl -s checkip.dyndns.com | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"`"
curl -s \
-F "token=app.token.key" \
-F "user=user.key" \
-F "message=$server_hostname IP is $ip" \
https://api.pushover.net/1/messages.json > /dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment