postrm 740 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # postrm for smartbotic-automation
  3. set -e
  4. SM_USER="smartbotic-automation"
  5. SM_GROUP="smartbotic-automation"
  6. case "$1" in
  7. purge)
  8. rm -rf /var/lib/smartbotic-automation /var/log/smartbotic-automation /etc/smartbotic-automation
  9. if getent passwd "$SM_USER" >/dev/null 2>&1; then
  10. deluser --system "$SM_USER" >/dev/null 2>&1 || true
  11. fi
  12. if getent group "$SM_GROUP" >/dev/null 2>&1; then
  13. delgroup --system "$SM_GROUP" >/dev/null 2>&1 || true
  14. fi
  15. ;;
  16. remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
  17. if [ -d /run/systemd/system ]; then
  18. systemctl daemon-reload >/dev/null 2>&1 || true
  19. fi
  20. ;;
  21. esac
  22. exit 0