Last active
October 27, 2016 04:38
-
-
Save joariasl/2527ac2edc1b87495d2e8569797d87c7 to your computer and use it in GitHub Desktop.
DDNS DonWeb NetworkManager /etc/NetworkManager/dispatcher.d/100_ddns.sh
This file contains 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/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