Skip to content

Instantly share code, notes, and snippets.

@joariasl
Last active October 27, 2016 04:38
Show Gist options
  • Save joariasl/2527ac2edc1b87495d2e8569797d87c7 to your computer and use it in GitHub Desktop.
Save joariasl/2527ac2edc1b87495d2e8569797d87c7 to your computer and use it in GitHub Desktop.
DDNS DonWeb NetworkManager /etc/NetworkManager/dispatcher.d/100_ddns.sh
#!/bin/sh
INTERFACE=$1 # The interface which is brought up or down
STATUS=$2 # The new state of the interface
case "$STATUS" in
'up') # $INTERFACE is up
if [[ "$INTERFACE" == "enp6s0" && $(hostname -i | grep "192.168.1.2" | cut -d " " -f 1) ]]; then
curl -basic -u "USERNAME:PASSWORD" -d "modulo=dnsDinamico&archivo=dnsDinamico&clienteDeActualizacion=api&op=actualizarHosts&hostNames[]=xxxxddn1.donweb-homeip.net" "https://administracion.donweb.com/ws/api.php"
fi
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment