philipp / rpms / dhcp

Forked from rpms/dhcp 4 years ago
Clone

Blame SOURCES/azure-cloud.sh

8377c7
#!/bin/sh
8377c7
#
8377c7
# This script provides support for dynamic DNS update in Microsoft Azure
8377c7
# cloud. To enable this feature, change the configuration variables below
8377c7
# and make the script executable.
8377c7
8377c7
primary_interface="eth0"
8377c7
required_domain="mydomain.local"
8377c7
dns_server="my-dns-server.mydomain.local"
8377c7
8377c7
# change the configuration variables above
8377c7
8377c7
[ "$interface" == "$primary_interface" ] || exit
8377c7
8377c7
case "$reason" in
8377c7
BOUND|RENEW|REBIND|REBOOT)
8377c7
    fqdn="`hostname`.$required_domain"
8377c7
    nsupdate <
8377c7
server $dns_server
8377c7
update delete $fqdn a
8377c7
update add $fqdn 3600 a $new_ip_address
8377c7
send
8377c7
EOF
8377c7
    ;;
8377c7
esac