telegraf/scripts/pre-remove.sh

16 lines
290 B
Bash
Raw Permalink Normal View History

#!/bin/bash
BIN_DIR=/usr/bin
# Distribution-specific logic
if [[ -f /etc/debian_version ]]; then
# Debian/Ubuntu logic
which systemctl &>/dev/null
if [[ $? -eq 0 ]]; then
deb-systemd-invoke stop telegraf.service
else
# Assuming sysv
invoke-rc.d telegraf stop
fi
fi