github.com/influxdata/telegraf@v1.30.3/scripts/deb/pre-remove.sh (about)

     1  #!/bin/bash
     2  
     3  if [ -d /run/systemd/system ]; then
     4  	if [ "$1" = remove ]; then
     5  		deb-systemd-invoke stop telegraf.service
     6  	fi
     7  else
     8  	# Assuming sysv
     9  	invoke-rc.d telegraf stop
    10  fi