diff options
Diffstat (limited to '')
-rwxr-xr-x | packaging/installer/netdata-uninstaller.sh | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/packaging/installer/netdata-uninstaller.sh b/packaging/installer/netdata-uninstaller.sh index 419002e6a..2f9fc91f9 100755 --- a/packaging/installer/netdata-uninstaller.sh +++ b/packaging/installer/netdata-uninstaller.sh @@ -158,7 +158,7 @@ create_tmp_directory() { fi fi - mktemp -d -t netdata-kickstart-XXXXXXXXXX + mktemp -d -t netdata-uninstaller-XXXXXXXXXX } tmpdir="$(create_tmp_directory)" @@ -725,25 +725,32 @@ rm_file /usr/lib/systemd/system/netdata-updater.service rm_file /etc/systemd/system/netdata-updater.timer rm_file /lib/systemd/system/netdata-updater.timer rm_file /usr/lib/systemd/system/netdata-updater.timer +rm_file /usr/lib/systemd/system-preset/50-netdata.preset +rm_file /lib/systemd/system-preset/50-netdata.preset rm_file /etc/init.d/netdata rm_file /etc/periodic/daily/netdata-updater rm_file /etc/cron.daily/netdata-updater rm_file /etc/cron.d/netdata-updater -if [ -n "${NETDATA_PREFIX}" ] && [ -d "${NETDATA_PREFIX}" ]; then +if [ -n "${NETDATA_PREFIX}" ] && [ -d "${NETDATA_PREFIX}" ] && [ "netdata" = "$(basename "$NETDATA_PREFIX")" ] ; then rm_dir "${NETDATA_PREFIX}" else - rm_file "/usr/sbin/netdata" - rm_file "/usr/sbin/netdatacli" + rm_file "${NETDATA_PREFIX}/usr/sbin/netdata" + rm_file "${NETDATA_PREFIX}/usr/sbin/netdatacli" rm_file "/tmp/netdata-ipc" - rm_file "/usr/sbin/netdata-claim.sh" - rm_dir "/usr/share/netdata" - rm_dir "/usr/libexec/netdata" - rm_dir "/var/lib/netdata" - rm_dir "/var/cache/netdata" - rm_dir "/var/log/netdata" - rm_dir "/etc/netdata" + rm_file "/tmp/netdata-service-cmds" + rm_file "${NETDATA_PREFIX}/usr/sbin/netdata-claim.sh" + rm_dir "${NETDATA_PREFIX}/usr/share/netdata" + rm_dir "${NETDATA_PREFIX}/usr/libexec/netdata" + rm_dir "${NETDATA_PREFIX}/var/lib/netdata" + rm_dir "${NETDATA_PREFIX}/var/cache/netdata" + rm_dir "${NETDATA_PREFIX}/var/log/netdata" + rm_dir "${NETDATA_PREFIX}/etc/netdata" +fi + +if [ -n "${tmpdir}" ]; then + run rm -rf "${tmpdir}" || true fi FILE_REMOVAL_STATUS=1 |