a small bash-script to refresh a dyn A
entry. Should work for many providers.
- simple bash-script (you don't have to install a program)
- logging (the response of the provider will be logged)
- clone the repository (for example in your home directory) and make
dyndns.sh
executeable
git clone https://github.com/sedrubal/dyndns-refresh.git && cd dyndns-refresh
chmod +x dyndns.sh
- copy the
config.cfg.example
toconfig.cfg
and edit it. You only have not to provide every variable:
cp config.cfg.example config.cfg
editor config.cfg
# provide following configs:
# - $url
# - $loggerpath
# - $logfile
- set file permissions:
sudo chown -R $USER:$GROUP .
sudo chmod 400 config.cfg
- check, if the script works
./dyndns.sh -v
tail $logfile
- create a crontab (
crontab -e -u $USER
) like this:
0/15 * * * * /home/$USER/dyndns.sh 2>&1
# │ └─┴─┴─┴─ every hour, day, month, weekday
# └────────── when minute == 15
- a crontab will trigger this script (default: every 15 minutes; you can change the interval)
- this scripts uses
curl
to request the update-website of the provider. He will notice your ip. - the output will be saved as log
- unix based os
- curl
- cron
- logger
- (logrotate)
- joker.com
- no-ip.com ?
- ...
- (automatic installation and support for crontab)
- check if parameter $1 == "-v" (bash is so complicated)
dyndns-refresh by sedrubal
is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.