Refresh gpg keys at a random time
This commit is contained in:
parent
f87db99db6
commit
87f76b3edd
|
@ -5315,10 +5315,11 @@ function configure_gpg {
|
|||
|
||||
function refresh_gpg_keys {
|
||||
if ! grep -q "${PROJECT_NAME}-sec --refresh" /etc/crontab; then
|
||||
GPG_REFRESH_TIME=$(( RANDOM % 60 ))
|
||||
if [ -f /usr/local/bin/freedombone-sec ]; then
|
||||
echo "0 */$REFRESH_GPG_KEYS_HOURS * * * root /usr/local/bin/${PROJECT_NAME}-sec --refresh > /dev/null" >> /etc/crontab
|
||||
echo "$GPG_REFRESH_TIME */$REFRESH_GPG_KEYS_HOURS * * * root /usr/local/bin/${PROJECT_NAME}-sec --refresh > /dev/null" >> /etc/crontab
|
||||
else
|
||||
echo "0 */$REFRESH_GPG_KEYS_HOURS * * * root /usr/bin/${PROJECT_NAME}-sec --refresh > /dev/null" >> /etc/crontab
|
||||
echo "$GPG_REFRESH_TIME */$REFRESH_GPG_KEYS_HOURS * * * root /usr/bin/${PROJECT_NAME}-sec --refresh > /dev/null" >> /etc/crontab
|
||||
fi
|
||||
systemctl restart cron
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue