1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_webapp_ynh.git synced 2024-09-03 19:46:26 +02:00

Remove PHP-FPM config before attempting to delete old system user

This commit is contained in:
tituspijean 2021-12-26 13:41:02 +01:00
parent e30b16245f
commit 6c9c7d3a09
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720

View file

@ -55,15 +55,6 @@ ynh_abort_if_errors
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# Delete old user
if [ -n "$(ynh_app_setting_get --app=$app --key=user)" ]
then
ynh_systemd_action --service_name=php${phpversion}-fpm --action=stop
ynh_system_user_delete --username="$(ynh_app_setting_get --app=$app --key=user)"
ynh_app_setting_delete --app=$app --key=user
ynh_systemd_action --service_name=php${phpversion}-fpm --action=start
fi
# If db_name doesn't exist, create it
if [ -z "$db_name" ]; then
db_name=$(ynh_sanitize_dbid --db_name=$app)
@ -106,6 +97,14 @@ if [ -z "$phpversion" ]; then
ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
fi
# Delete old user
if [ -n "$(ynh_app_setting_get --app=$app --key=user)" ]
then
ynh_systemd_action --service_name=php${phpversion}-fpm --action=stop
ynh_system_user_delete --username="$(ynh_app_setting_get --app=$app --key=user)"
ynh_app_setting_delete --app=$app --key=user
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all