mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 09:47:00 +08:00
update.sh: ddns sleep for random seconds to avoid burst
This commit is contained in:
parent
8eb2088331
commit
8f3b053bbd
|
@ -13,6 +13,11 @@ apost_beacon "sys.online"
|
||||||
# update dns
|
# update dns
|
||||||
if [[ "$DFS_DDNS_ENABLE" == "1" ]]; then
|
if [[ "$DFS_DDNS_ENABLE" == "1" ]]; then
|
||||||
fmt_info "updating dns ..."
|
fmt_info "updating dns ..."
|
||||||
|
if ! is_tty; then
|
||||||
|
time_to_sleep=$((RANDOM%600))
|
||||||
|
fmt_note "sleep for $time_to_sleep seconds"
|
||||||
|
sleep $time_to_sleep
|
||||||
|
fi
|
||||||
"$THIS_DIR/tools/frigg-client.sh" ddns || (fmt_error "failed to update dns" && apost_beacon "dfs.ddns.fail")
|
"$THIS_DIR/tools/frigg-client.sh" ddns || (fmt_error "failed to update dns" && apost_beacon "dfs.ddns.fail")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user