From d3057a6db38f8bce2327369efbe6e22a32967817 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 7 Apr 2018 18:40:48 +0100 Subject: [PATCH] Change ownership if file exists --- src/freedombone-client | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedombone-client b/src/freedombone-client index 02a9cbe5..e2ad1baa 100755 --- a/src/freedombone-client +++ b/src/freedombone-client @@ -94,8 +94,8 @@ function refresh_gpg_keys { fi fi sudo cp /etc/crontab ~/temp_crontab - sudo chown "$CURR_USER":"$CURR_GROUP" ~/temp_crontab if [ -f ~/temp_crontab ]; then + sudo chown "$CURR_USER":"$CURR_GROUP" ~/temp_crontab if grep -q 'test' ~/temp_crontab; then if ! grep -q 'gpg --refresh-keys' ~/temp_crontab; then echo "0 */$REFRESH_GPG_KEYS_HOURS * * * $CURR_USER /usr/bin/gpg --refresh-keys > /dev/null" >> ~/temp_crontab