2017-01-05 23:37:07 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-12-09 00:35:51 +01:00
|
|
|
source _common.sh
|
2020-11-17 23:37:38 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
2024-04-04 00:28:32 +02:00
|
|
|
load_vars
|
2020-11-17 23:37:38 +01:00
|
|
|
|
2018-01-31 16:07:43 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
2023-12-09 00:35:51 +01:00
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
|
|
#=================================================
|
2018-01-31 16:07:43 +01:00
|
|
|
|
2023-12-09 00:35:51 +01:00
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
2024-08-31 01:07:34 +02:00
|
|
|
if ynh_hide_warnings yunohost service status "$app" >/dev/null
|
2023-12-09 00:35:51 +01:00
|
|
|
then
|
2024-08-31 01:07:34 +02:00
|
|
|
ynh_script_progression "Removing $app service integration..."
|
2024-04-04 00:28:32 +02:00
|
|
|
yunohost service remove "$app"
|
2023-12-09 00:35:51 +01:00
|
|
|
fi
|
2017-01-05 23:37:07 +01:00
|
|
|
|
2023-12-09 00:35:51 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE SYSTEM CONFIGURATIONS
|
|
|
|
#=================================================
|
2024-08-31 01:07:34 +02:00
|
|
|
ynh_script_progression "Removing system configurations related to $app..."
|
2017-01-05 23:37:07 +01:00
|
|
|
|
2024-08-31 01:07:34 +02:00
|
|
|
ynh_systemctl --service="$app" --action="stop" --log_path="systemd" --timeout=15
|
2017-10-30 21:59:43 +01:00
|
|
|
|
2024-08-31 01:07:34 +02:00
|
|
|
ynh_safe_rm "$nginx_status_conf"
|
|
|
|
ynh_config_remove_nginx
|
2018-05-07 23:08:03 +02:00
|
|
|
|
2024-08-31 01:07:34 +02:00
|
|
|
ynh_config_remove_systemd
|
2023-01-22 03:09:34 +01:00
|
|
|
|
2024-04-04 00:28:32 +02:00
|
|
|
# Remove the app-specific logrotate config
|
2024-08-31 01:07:34 +02:00
|
|
|
ynh_config_remove_logrotate
|
2024-04-04 00:28:32 +02:00
|
|
|
|
|
|
|
for pool_dir_by_version in /etc/php/*; do
|
|
|
|
pool_version=$(echo "$pool_dir_by_version" | cut -d/ -f4)
|
|
|
|
pool_file="/etc/php/$pool_version/fpm/pool.d/${app}_status.conf"
|
2024-08-31 01:07:34 +02:00
|
|
|
ynh_safe_rm "$pool_file"
|
2024-08-31 11:23:10 +02:00
|
|
|
if _ynh_apt_package_is_installed "php$pool_version-fpm"; then
|
2024-08-31 01:07:34 +02:00
|
|
|
ynh_systemctl --service="php$pool_version"-fpm.service --action=reload
|
2024-04-04 00:28:32 +02:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2024-04-27 00:53:41 +02:00
|
|
|
if ynh_psql_user_exists --user="$db_user"; then
|
|
|
|
ynh_psql_drop_user "$db_user"
|
2024-04-04 00:28:32 +02:00
|
|
|
fi
|
2024-04-27 00:53:41 +02:00
|
|
|
if ynh_mysql_user_exists --user="$db_user"; then
|
|
|
|
ynh_mysql_drop_user "$db_user"
|
2024-04-04 00:28:32 +02:00
|
|
|
fi
|
|
|
|
|
2024-08-31 01:07:34 +02:00
|
|
|
_ynh_apt autoremove --purge monitorix
|
|
|
|
ynh_safe_rm "$install_dir"
|
2019-06-07 23:09:30 +02:00
|
|
|
|
2024-08-31 01:07:34 +02:00
|
|
|
ynh_script_progression "Removal of $app completed"
|