2016-02-23 17:25:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
BIN_DIR=/usr/bin
|
|
|
|
|
|
|
|
# Distribution-specific logic
|
|
|
|
if [[ -f /etc/debian_version ]]; then
|
|
|
|
# Debian/Ubuntu logic
|
2017-04-20 18:19:33 +00:00
|
|
|
if [[ "$(readlink /proc/1/exe)" == */systemd ]]; then
|
|
|
|
deb-systemd-invoke stop telegraf.service
|
2016-02-23 17:25:07 +00:00
|
|
|
else
|
2017-04-20 18:19:33 +00:00
|
|
|
# Assuming sysv
|
|
|
|
invoke-rc.d telegraf stop
|
2016-02-23 17:25:07 +00:00
|
|
|
fi
|
|
|
|
fi
|