mirror of
https://github.com/laurivosandi/certidude
synced 2024-12-23 00:25:18 +00:00
17 lines
401 B
Bash
17 lines
401 B
Bash
#!/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
|
|
|