Last active
September 7, 2021 08:48
-
-
Save isnikulin/cc4be9634aee3cc85c9e0a2d51008216 to your computer and use it in GitHub Desktop.
Duck DNS AWS ubuntu startup script
This file contains hidden or 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/bash | |
#Adopted from https://cloudhobbyist.com/aws-vpn-2/ | |
DDNS_DOMAIN="PUT_YOUR_DOMAIN_HERE" | |
DDNS_TOKEN="PUT_YOUR_API_TOKEN_HERE" | |
#DDNS setup | |
mkdir /home/ubuntu/duckdns | |
touch /home/ubuntu/duckdns/duck.sh | |
echo "#!/bin/bash | |
curl -o /home/ubuntu/duckdns/duck.log \"https://www.duckdns.org/update?domains={$DDNS_DOMAIN}\ | |
&token={$DDNS_TOKEN}\" | |
echo "" >> /home/ubuntu/duckdns/duck.log" >/home/ubuntu/duckdns/duck.sh | |
chmod +x /home/ubuntu/duckdns/duck.sh | |
crontab -l | { cat; echo "*/5 * * * * /home/ubuntu/duckdns/duck.sh >/dev/null 2>&1"; } | crontab - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment