mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-07-07 15:22:48 +00:00
Merge branch 'random-cron'
This commit is contained in:
commit
a929fda2a3
14
acme.sh
14
acme.sh
@ -4420,17 +4420,17 @@ installcronjob() {
|
|||||||
fi
|
fi
|
||||||
_t=$(_time)
|
_t=$(_time)
|
||||||
random_minute=$(_math $_t % 60)
|
random_minute=$(_math $_t % 60)
|
||||||
|
random_hour1=$(_math $_t / 60 % 12)
|
||||||
|
random_hour2=$(_math $random_hour1 + 12)
|
||||||
if _exists uname && uname -a | grep SunOS >/dev/null; then
|
if _exists uname && uname -a | grep SunOS >/dev/null; then
|
||||||
crontab -l | {
|
ct_stdin=--
|
||||||
cat
|
|
||||||
echo "$random_minute 0 * * * $lesh --cron --home \"$LE_WORKING_DIR\" $_c_entry> /dev/null"
|
|
||||||
} | crontab --
|
|
||||||
else
|
else
|
||||||
|
ct_stdin=-
|
||||||
|
fi
|
||||||
crontab -l | {
|
crontab -l | {
|
||||||
cat
|
cat
|
||||||
echo "$random_minute 0 * * * $lesh --cron --home \"$LE_WORKING_DIR\" $_c_entry> /dev/null"
|
echo "$random_minute $random_hour1,$random_hour2 * * * $lesh --cron --home \"$LE_WORKING_DIR\" $_c_entry> /dev/null"
|
||||||
} | crontab -
|
} | crontab $ct_stdin
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
_err "Install cron job failed. You need to manually renew your certs."
|
_err "Install cron job failed. You need to manually renew your certs."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user