瀏覽代碼

Change ownership if file exists

Bob Mottram 7 年之前
父節點
當前提交
d3057a6db3
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      src/freedombone-client

+ 1
- 1
src/freedombone-client 查看文件

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