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:
parent
e30b16245f
commit
6c9c7d3a09
1 changed files with 8 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue