Don't report every gpg key refresh

This commit is contained in:
Bob Mottram 2016-05-13 09:55:51 +01:00
parent fdc426bbd8
commit 141aec2619
1 changed files with 3 additions and 3 deletions

View File

@ -5327,9 +5327,9 @@ function refresh_gpg_keys {
REFRESH_GPG_KEYS_SCRIPT=/usr/bin/update-gpg-keys REFRESH_GPG_KEYS_SCRIPT=/usr/bin/update-gpg-keys
echo '#!/bin/bash' > $REFRESH_GPG_KEYS_SCRIPT echo '#!/bin/bash' > $REFRESH_GPG_KEYS_SCRIPT
echo "if [ -f /usr/local/bin/${PROJECT_NAME}-sec ]; then" >> $REFRESH_GPG_KEYS_SCRIPT echo "if [ -f /usr/local/bin/${PROJECT_NAME}-sec ]; then" >> $REFRESH_GPG_KEYS_SCRIPT
echo " /usr/bin/timeout 600 /usr/local/bin/${PROJECT_NAME}-sec --refresh yes > /dev/null" >> $REFRESH_GPG_KEYS_SCRIPT echo " /usr/bin/timeout 600 /usr/local/bin/${PROJECT_NAME}-sec --refresh yes" >> $REFRESH_GPG_KEYS_SCRIPT
echo 'else' >> $REFRESH_GPG_KEYS_SCRIPT echo 'else' >> $REFRESH_GPG_KEYS_SCRIPT
echo " /usr/bin/timeout 600 /usr/bin/${PROJECT_NAME}-sec --refresh yes > /dev/null" >> $REFRESH_GPG_KEYS_SCRIPT echo " /usr/bin/timeout 600 /usr/bin/${PROJECT_NAME}-sec --refresh yes" >> $REFRESH_GPG_KEYS_SCRIPT
echo 'fi' >> $REFRESH_GPG_KEYS_SCRIPT echo 'fi' >> $REFRESH_GPG_KEYS_SCRIPT
chmod +x $REFRESH_GPG_KEYS_SCRIPT chmod +x $REFRESH_GPG_KEYS_SCRIPT
@ -5338,7 +5338,7 @@ function refresh_gpg_keys {
fi fi
if ! grep -q "$REFRESH_GPG_KEYS_SCRIPT" /etc/crontab; then if ! grep -q "$REFRESH_GPG_KEYS_SCRIPT" /etc/crontab; then
GPG_REFRESH_TIME=$(( RANDOM % 60 )) GPG_REFRESH_TIME=$(( RANDOM % 60 ))
echo "$GPG_REFRESH_TIME */$REFRESH_GPG_KEYS_HOURS * * * root $REFRESH_GPG_KEYS_SCRIPT" >> /etc/crontab echo "$GPG_REFRESH_TIME */$REFRESH_GPG_KEYS_HOURS * * * root $REFRESH_GPG_KEYS_SCRIPT 2>&1 > /dev/null" >> /etc/crontab
systemctl restart cron systemctl restart cron
fi fi
} }