diff --git a/scripts/install b/scripts/install index 3797b0d..d5007d8 100644 --- a/scripts/install +++ b/scripts/install @@ -58,6 +58,7 @@ fi # Set permissions to app files sudo chown -R root: $src_path sudo chmod -R ga+w $src_path/data +sudo chown -R $admin "$books_path" cp password.php $src_path/ynh_password.php cd $src_path diff --git a/scripts/remove b/scripts/remove index 5d148ef..667bfef 100644 --- a/scripts/remove +++ b/scripts/remove @@ -8,13 +8,17 @@ source /usr/share/yunohost/helpers # Retrieve app settings domain=$(ynh_app_setting_get "$app" domain) +admin=$(ynh_app_setting_get "$app" admin) +books_path=/home/$admin/calibre_library # Remove php5-sqlite dependency ynh_package_remove php5-sqlite # Remove sources sudo rm -rf /var/www/$app -sudo rm -rf /var/www/${app}_library + +# Remove calibre library +sudo rm -rf $books_path # Remove nginx configuration file sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf diff --git a/scripts/restore b/scripts/restore index d18eb6a..9df957c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,7 +30,8 @@ sudo cp -a ./data "$books_path" # Restore permissions to app files # you may need to make some file and/or directory writeable by www-data (nginx user) -sudo chown -R root: "$src_path" "${src_path}_library" +sudo chown -R root: "$src_path" +sudo chown -R $admin "$books_path" ### MySQL (remove if not used) ### # If a MySQL database is used: