1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
SERVICE=ecbd.service post_install() { systemctl enable --now $SERVICE } pre_remove() { [[ $(systemctl is-enabled $SERVICE) ]] && systemctl disable --now $SERVICE } post_upgrade() { if systemctl is-active $SERVICE; then systemctl daemon-reload systemctl restart $SERVICE fi }