DDNS stuff (FreeDNS & SelfHOST.de cronjobs)

This commit is contained in:
Papa Dragon 2022-04-09 02:50:43 +02:00
parent fa2022d798
commit c4312e1c90
2 changed files with 5 additions and 3 deletions

View file

@ -64,7 +64,8 @@ function configure_cron_freedns {
# Use cron for dynamich ip update
# - at reboot
# - every 30 minutes
if [ -z "`grep $freedns_key /etc/crontab`" ]
grep $freedns_key /etc/crontab
if [ $? != 0 ]
then
echo "@reboot root http://freedns.afraid.org/dynamic/update.php?$freedns_key > /dev/null 2>&1" >> /etc/crontab
echo "*/30 * * * * root wget --no-check-certificate -O - http://freedns.afraid.org/dynamic/update.php?$freedns_key > /dev/null 2>&1" >> /etc/crontab

View file

@ -64,12 +64,13 @@ function configure_cron_selfhost {
# Use cron for dynamich ip update
# - at reboot
# - every 5 minutes
if [ -z "`grep $selfhostscript /etc/crontab`" ]
grep $selfhostscript /etc/crontab
if [ $? != 0 ]
then
echo "@reboot root bash $selfhostdir/$selfhostscript update > /dev/null 2>&1" >> /etc/crontab
echo "*/5 * * * * root /bin/bash $selfhostdir/$selfhostscript update > /dev/null 2>&1" >> /etc/crontab
else
print_info "cron for selfhost was configured already"
print_info "cron for selfHOST was configured already"
fi
}