feat: 对齐 xxxig/proxy 打包规范并迁移配置至 /etc/mond
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Vendored
+13
-31
@@ -1,36 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
upgrade)
|
||||
# 升级时只停止服务,保留 enabled 状态
|
||||
if [ -d /run/systemd/system ]; then
|
||||
if systemctl is-active --quiet mond.service; then
|
||||
echo "Stopping mond service for upgrade..."
|
||||
systemctl stop mond.service
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
remove|deconfigure)
|
||||
# 删除时停止并禁用服务
|
||||
if [ -d /run/systemd/system ]; then
|
||||
if systemctl is-active --quiet mond.service; then
|
||||
echo "Stopping mond service..."
|
||||
systemctl stop mond.service
|
||||
fi
|
||||
if systemctl is-enabled --quiet mond.service 2>/dev/null; then
|
||||
echo "Disabling mond service..."
|
||||
systemctl disable mond.service
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
failed-upgrade)
|
||||
# 升级失败时不做操作
|
||||
;;
|
||||
*)
|
||||
echo "prerm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
# 仅在卸载(remove)时停用服务;升级(upgrade)时保持运行,
|
||||
# 由 postinst 的 try-restart 重启以加载新二进制
|
||||
if [ "$1" = "remove" ] && [ -d /run/systemd/system ]; then
|
||||
if systemctl is-active --quiet mond.service; then
|
||||
echo "Stopping mond service..."
|
||||
systemctl stop mond.service
|
||||
fi
|
||||
|
||||
if systemctl is-enabled --quiet mond.service 2>/dev/null; then
|
||||
echo "Disabling mond service..."
|
||||
systemctl disable mond.service
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user