Ensure correct permissions on data directory during upgrades

This commit is contained in:
Bob Mottram 2018-05-13 19:42:03 +01:00
parent ea971e5682
commit a14781337f
1 changed files with 5 additions and 4 deletions

View File

@ -154,15 +154,16 @@ function reconfigure_privatebin {
}
function upgrade_privatebin {
if grep -q "privatebin domain" "$COMPLETION_FILE"; then
PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
fi
chmod 755 "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/data"
CURR_PRIVATEBIN_COMMIT=$(get_completion_param "privatebin commit")
if [[ "$CURR_PRIVATEBIN_COMMIT" == "$PRIVATEBIN_COMMIT" ]]; then
return
fi
if grep -q "privatebin domain" "$COMPLETION_FILE"; then
PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
fi
# update to the next commit
function_check set_repo_commit
set_repo_commit "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs" "privatebin commit" "$PRIVATEBIN_COMMIT" "$PRIVATEBIN_REPO"