navilg / godaddy-ddns

Dynamic DNS with GoDaddy
https://medium.com/linux-shots
MIT License
57 stars 15 forks source link

Use source command to read variables from properties file #3

Closed navilg closed 4 years ago

navilg commented 4 years ago

Replace existing (below) method with source command to read variables from godaddyDDNS.properties file.

domain="$(grep -i domain "$properties_file"|tail -1|awk -F "=" '{print $2}')"           #domain name

name="$(grep -i name "$properties_file"|tail -1|awk -F "=" '{print $2}')"           #sub-domain

ttl="$(grep -i ttl "$properties_file"|tail -1|awk -F "=" '{print $2}')"

key="$(grep -i key "$properties_file"|tail -1|awk -F "=" '{print $2}')"             #godaddy developer key

secret="$(grep -i secret "$properties_file"|tail -1|awk -F "=" '{print $2}')"           #godaddy developer secret