mihomo-party/build/linux/postuninst
Moon 236ad0ab43
fix: postuninst & postinst script in Linux (#1295)
* refactor: Postinstall script in linux

* fix: add postuninst script in linux
2025-10-20 07:29:35 +08:00

23 lines
556 B
Bash

#!/bin/bash
case "$1" in
remove|purge|0)
if type update-alternatives >/dev/null 2>&1; then
update-alternatives --remove 'mihomo-party' '/opt/mihomo-party/mihomo-party' 2>/dev/null || true
fi
[ -L '/usr/bin/mihomo-party' ] && rm -f '/usr/bin/mihomo-party'
if hash update-mime-database 2>/dev/null; then
update-mime-database /usr/share/mime || true
fi
if hash update-desktop-database 2>/dev/null; then
update-desktop-database /usr/share/applications || true
fi
;;
*)
# others
;;
esac