1
0
mirror of https://github.com/laurivosandi/certidude synced 2024-11-01 11:06:25 +00:00
certidude/doc/overlay/etc/uci-defaults/60-cron

15 lines
390 B
Plaintext
Raw Normal View History

# Randomize restart time
OFFSET=$(awk -v min=1 -v max=59 'BEGIN{srand(); print int(min+rand()*(max-min+1))}')
# wtf?! https://wiki.strongswan.org/issues/1501#note-7
cat << EOF > /etc/crontabs/root
#$OFFSET 2 * * * sleep 70 && touch /etc/banner && reboot
$OFFSET 2 * * * ipsec restart
5 1 1 */2 * /usr/bin/certidude-enroll-renew
EOF
chmod 0600 /etc/crontabs/root
/etc/init.d/cron enable