Skip to content

Instantly share code, notes, and snippets.

@sillyslux
Created March 2, 2020 17:50
Show Gist options
  • Save sillyslux/9a190058e1882de20016dbb9a2cca8e7 to your computer and use it in GitHub Desktop.
Save sillyslux/9a190058e1882de20016dbb9a2cca8e7 to your computer and use it in GitHub Desktop.
changeip update script
#!/bin/sh
#
# /etc/network/if-up.d/custom-dyndns
#
# Update dynamic dns provider changeip.com.
#
# Create a link with:
# `sudo ln ~/.bin/changeipcom /etc/network/if-up.d/custom-dyndns`
#
# Save your sensitive data in /root/secrets:
# export CHANGEIP_HOST=hostname
# export CHANGEIP_USER=username
# export CHANGEIP_PWD=password
#
# Copyright (C) 2018 Silly S. Lux - All Rights Reserved
# Permission to copy and modify is granted under the MIT license
# Last revised 3/14/2018
if [ $IFACE = ppp0 ] && [ $MODE = start ] && [ $PHASE = post-up ]; then
. /root/secrets
PPPIP=${IP4_ADDRESS_0%/*}
MSG=$(wget -qO - https://nic.changeip.com/nic/update?u=$CHANGEIP_USER\&p=$CHANGEIP_PWD\&hostname=$CHANGEIP_HOST\&ip=$PPPIP)
logger -p local0.info "changeip.org: $MSG ($PPPIP)"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment