This script is used to update the Dynamic DNS (DDNS) service based on MongoDB, specifically for those using Indih*ome ISP π. It is written in Bash and can automatically change the access list in MongoDB.
git clone https://github.com/z3rsa/mongodb-ddns-updater.git
This script is used with crontab. Specify the frequency of execution through crontab.
# ββββββββββββββ minute/menit (0 - 59)
# β ββββββββββββββ hour/jam (0 - 23)
# β β ββββββββββββββ day/hari of the month (1 - 31)
# β β β ββββββββββββββ month/bulan (1 - 12)
# β β β β ββββββββββββββ day/hari of the week (0 - 6) (Sunday to Saturday 7 is also Sunday on some systems)
# β β β β β ββββββββββββββ command to issue
# β β β β β β
# β β β β β β
# * * * * * /bin/bash {Location of the script}
If you're using Raspberry Pi, make sure to add a delay before running the script:
@reboot sleep 180 && bash /path/to/your/script
Success Add IP Address on Access List
Fail to add, Already IP Address on Access List
This script was made with reference from K0p1-Git | Cloudflare Dynamic DNS IP Updater Github.