1
0
mirror of https://github.com/laurivosandi/certidude synced 2024-12-23 08:35:19 +00:00
certidude/doc/overlay/etc/uci-defaults/60-cron

17 lines
401 B
Plaintext
Raw Normal View History

2018-05-17 13:14:59 +00:00
#!/bin/sh
# 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