Improved install script for packaged telegraf:
* Start/stop service on Debian/Ubuntu * Disable init-script/Systemd-unit on package removal closes #747
This commit is contained in:
committed by
Cameron Sparr
parent
035e4cf90a
commit
e4e7d7fbfc
15
scripts/pre-remove.sh
Normal file
15
scripts/pre-remove.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user