Browse Source

Change ownership if file exists

Bob Mottram 7 years ago
parent
commit
d3057a6db3
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/freedombone-client

+ 1
- 1
src/freedombone-client View File

94
         fi
94
         fi
95
     fi
95
     fi
96
     sudo cp /etc/crontab ~/temp_crontab
96
     sudo cp /etc/crontab ~/temp_crontab
97
-    sudo chown "$CURR_USER":"$CURR_GROUP" ~/temp_crontab
98
     if [ -f ~/temp_crontab ]; then
97
     if [ -f ~/temp_crontab ]; then
98
+        sudo chown "$CURR_USER":"$CURR_GROUP" ~/temp_crontab
99
         if grep -q 'test' ~/temp_crontab; then
99
         if grep -q 'test' ~/temp_crontab; then
100
             if ! grep -q 'gpg --refresh-keys' ~/temp_crontab; then
100
             if ! grep -q 'gpg --refresh-keys' ~/temp_crontab; then
101
                 echo "0            */$REFRESH_GPG_KEYS_HOURS *   *   *   $CURR_USER /usr/bin/gpg --refresh-keys > /dev/null" >> ~/temp_crontab
101
                 echo "0            */$REFRESH_GPG_KEYS_HOURS *   *   *   $CURR_USER /usr/bin/gpg --refresh-keys > /dev/null" >> ~/temp_crontab