From c6777185ef93f54ad0397b9458f9d060c584faa4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 11 Apr 2021 22:34:21 +0200 Subject: [PATCH] Fix rights --- scripts/install | 2 +- scripts/remove | 4 ++-- scripts/restore | 30 +++++++++++++++--------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/scripts/install b/scripts/install index 6532b5d..4744d0b 100644 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ mkdir -p "$final_path/$app" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION diff --git a/scripts/remove b/scripts/remove index d6f734c..51b5697 100644 --- a/scripts/remove +++ b/scripts/remove @@ -64,6 +64,8 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# SPECIFIC REMOVE #================================================= # REMOVE SWAP #================================================= @@ -71,8 +73,6 @@ ynh_script_progression --message="Removing swap..." ynh_del_swap -#================================================= -# SPECIFIC REMOVE #================================================= # REMOVE THE CRON FILE #================================================= diff --git a/scripts/restore b/scripts/restore index d81ee5c..fa4c5dc 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,7 +68,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -84,6 +84,20 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC RESTORATION +#================================================= +# RESTORE THE CRON FILE +#================================================= +ynh_script_progression --message="Restoring the cron file..." + +ynh_restore_file --origin_path="/etc/cron.d/$app" + +#================================================= +# ADD SWAP +#================================================= +ynh_script_progression --message="Adding swap..." + +ynh_add_swap --size=$swap_needed + #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -101,20 +115,6 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql -#================================================= -# RESTORE THE CRON FILE -#================================================= -ynh_script_progression --message="Restoring the cron file..." - -ynh_restore_file --origin_path="/etc/cron.d/$app" - -#================================================= -# ADD SWAP -#================================================= -ynh_script_progression --message="Adding swap..." - -ynh_add_swap --size=$swap_needed - #================================================= # GENERIC FINALIZATION #=================================================