Blame SOURCES/azure-cloud.sh

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