Files
dhcp-dns-manager/uninstall.sh
T
CNBUGS AI 8ad4c3576d Fix DHCP client unable to get IP and config not persisting
- Fixed verifyAssignment being too strict for new clients
- Fixed parseRequestedIP string conversion bug
- Fixed response sent to 0.0.0.0 instead of broadcast address
- Added SO_BROADCAST support for UDP socket
- Fixed session persistence after page refresh (localStorage)
- Added in-memory session store for auth middleware
- Added config reloader so DHCP server picks up web UI changes dynamically
2026-04-24 16:03:54 +08:00

54 line
1.4 KiB
Bash
Executable File

#!/bin/bash
# ========================================
# DHCP & DNS 管理器 - Linux 卸载脚本
# ========================================
set -e
INSTALL_DIR="/opt/dhcp-dns-manager"
SERVICE_NAME="dhcp-dns-manager"
echo "⚠️ 警告:这将卸载 DHCP & DNS 管理器"
echo ""
read -p "是否继续?(y/N): " confirm
if [ "$confirm" != "y" ] && [ "$confirm" != "Y" ]; then
echo "已取消"
exit 0
fi
# 停止服务
echo "🛑 停止服务..."
systemctl stop $SERVICE_NAME || true
systemctl disable $SERVICE_NAME || true
# 删除 systemd 服务
echo "🗑️ 删除 systemd 服务..."
rm -f /etc/systemd/system/$SERVICE_NAME.service
systemctl daemon-reload
# 删除安装目录
echo "🗑️ 删除安装目录..."
rm -rf $INSTALL_DIR
# 删除防火墙规则
echo "🔥 清理防火墙规则..."
if command -v ufw &> /dev/null; then
ufw delete allow 53/udp || true
ufw delete allow 67/udp || true
ufw delete allow 8080/tcp || true
elif command -v firewall-cmd &> /dev/null; then
firewall-cmd --permanent --remove-port=53/udp || true
firewall-cmd --permanent --remove-port=67/udp || true
firewall-cmd --permanent --remove-port=8080/tcp || true
firewall-cmd --reload || true
fi
echo ""
echo "✅ 卸载完成!"
echo ""
echo "注意:数据库文件已删除,如需保留请提前备份:"
echo " $INSTALL_DIR/data/dhcp-dns.db"
echo ""