1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/weblate_ynh.git synced 2024-10-01 13:35:04 +02:00

Improve removal script

This commit is contained in:
Jean-Baptiste Holcroft 2017-09-21 14:48:29 +02:00
parent b00a284060
commit b36ebe8fd0

View file

@ -23,12 +23,20 @@ db_name=$(ynh_app_setting_get $app db_name)
# REMOVE SERVICE FROM ADMIN PANEL # REMOVE SERVICE FROM ADMIN PANEL
#================================================= #=================================================
if yunohost service status | grep -q $app if yunohost service status | grep -q "$app"
then then
echo "Remove $app service" echo "Remove $app service"
yunohost service remove $app.service systemctl stop "$app.service"
yunohost service remove "$app.service"
fi fi
#=================================================
# REMOVE THE PostgreSQL DATABASE
#=================================================
# Remove a database if it exists, along with the associated user
ynh_psql_remove_db "$db_name" "$app"
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
@ -36,13 +44,6 @@ fi
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
ynh_remove_app_dependencies ynh_remove_app_dependencies
#=================================================
# REMOVE THE PostgreSQL DATABASE
#=================================================
# Remove a database if it exists, along with the associated user
ynh_psql_remove_db $db_name $app
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================