#!/bin/bash #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then yunohost service remove "$app" fi # Remove the dedicated NGINX config ynh_remove_nginx_config ynh_systemd_action --service_name="$app" --action="stop" #================================================= # UNINSTALLING NETDATA #================================================= ynh_script_progression --message="Uninstalling Netdata..." --weight=6 # Kill all netdata processes (essentially what the official uninstaller does) pkill netdata pkill -U netdata # Rm all files that netdata may have installed (this is copypasta of the official uninstaller script) ynh_secure_remove /etc/logrotate.d/netdata ynh_secure_remove /etc/systemd/system/netdata.service ynh_secure_remove /lib/systemd/system/netdata.service ynh_secure_remove /usr/lib/systemd/system/netdata.service ynh_secure_remove /etc/init.d/netdata ynh_secure_remove /etc/periodic/daily/netdata-updater ynh_secure_remove /etc/cron.daily/netdata-updater ynh_secure_remove "/usr/sbin/netdata" ynh_secure_remove "/usr/share/netdata" ynh_secure_remove "/usr/libexec/netdata" ynh_secure_remove "/var/lib/netdata" ynh_secure_remove "/var/cache/netdata" ynh_secure_remove "/etc/netdata" #================================================= # END OF SCRIPT #================================================= ynh_script_progression --message="Removal of $app completed" --last