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

     1  #!/bin/bash
     2  
     3  # Telegraf is no longer installed, remove from systemd
     4  if [[ "$1" = "0" ]]; then
     5      rm -f /etc/default/telegraf
     6  
     7      if [[ -d /run/systemd/system ]]; then
     8          systemctl disable telegraf
     9          rm -f /usr/lib/systemd/system/telegraf.service
    10          systemctl daemon-reload
    11      fi
    12  fi
    13  
    14  # Telegraf upgrade, restart service
    15  if [[ $1 -ge 1 ]]; then
    16      if [[ -d /run/systemd/system ]]; then
    17          systemctl try-restart telegraf.service >/dev/null 2>&1 || :
    18      fi
    19  fi