mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
dyndns cron: validate that we're connected to the internet before triggering yunohost dyndns update
This commit is contained in:
parent
c7038b0e59
commit
55bacd7405
1 changed files with 6 additions and 1 deletions
|
@ -105,7 +105,12 @@ EOF
|
|||
if ls -l /etc/yunohost/dyndns/K*.private 2>/dev/null; then
|
||||
cat >$pending_dir/etc/cron.d/yunohost-dyndns <<EOF
|
||||
SHELL=/bin/bash
|
||||
*/10 * * * * root : YunoHost DynDNS update; sleep \$((RANDOM\\%60)); test -e /var/run/moulinette_yunohost.lock || yunohost dyndns update >> /dev/null
|
||||
# Every 10 minutes,
|
||||
# - (sleep random 60 is here to spread requests over a 1-min window)
|
||||
# - if ip.yunohost.org answers ping (basic check to validate that we're connected to the internet and yunohost infra aint down)
|
||||
# - and if lock ain't already taken by another command
|
||||
# - trigger yunohost dyndns update
|
||||
*/10 * * * * root : YunoHost DynDNS update; sleep \$((RANDOM\\%60)); ! ping -q -W5 -c1 ip.yunohost.org >/dev/null 2>&1 || test -e /var/run/moulinette_yunohost.lock || yunohost dyndns update >> /dev/null
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue