Files
mond/debian/postrm
Wang Defa 2493344eba
Some checks failed
Build and Release Mond / build-and-test (arm64, alpine) (push) Failing after 1m3s
Build and Release Mond / build-and-test (amd64, alpine) (push) Failing after 1m39s
Build and Release Mond / build-and-test (arm64, ubuntu) (push) Failing after 2m24s
Build and Release Mond / build-and-test (amd64, ubuntu) (push) Failing after 3m2s
Build and Release Mond / release (push) Has been skipped
首次提交
2025-12-15 11:15:14 +08:00

43 lines
954 B
Bash
Executable File

#!/bin/sh
set -e
case "$1" in
purge)
# Remove user and group
if getent passwd mond >/dev/null; then
deluser --quiet mond || true
fi
if getent group mond >/dev/null; then
delgroup --quiet mond || true
fi
# Remove log directory
rm -rf /var/log/mond
# Note: We keep /var/lib/mond (blockchain data) for safety
# Users can manually remove it if needed
echo ""
echo "⚠️ Blockchain data preserved at: /var/lib/mond"
echo "To completely remove all data, run:"
echo " sudo rm -rf /var/lib/mond"
echo ""
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
# Do nothing
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# Reload systemd
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi
exit 0