Browse Source

Ensure correct permissions on data directory during upgrades

Bob Mottram 6 years ago
parent
commit
a14781337f
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      src/freedombone-app-privatebin

+ 5
- 4
src/freedombone-app-privatebin View File

@@ -154,15 +154,16 @@ function reconfigure_privatebin {
154 154
 }
155 155
 
156 156
 function upgrade_privatebin {
157
+    if grep -q "privatebin domain" "$COMPLETION_FILE"; then
158
+        PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
159
+    fi
160
+    chmod 755 "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/data"
161
+
157 162
     CURR_PRIVATEBIN_COMMIT=$(get_completion_param "privatebin commit")
158 163
     if [[ "$CURR_PRIVATEBIN_COMMIT" == "$PRIVATEBIN_COMMIT" ]]; then
159 164
         return
160 165
     fi
161 166
 
162
-    if grep -q "privatebin domain" "$COMPLETION_FILE"; then
163
-        PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
164
-    fi
165
-
166 167
     # update to the next commit
167 168
     function_check set_repo_commit
168 169
     set_repo_commit "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs" "privatebin commit" "$PRIVATEBIN_COMMIT" "$PRIVATEBIN_REPO"