diff --git a/menu.sh b/menu.sh index 112e351..bec0d5e 100644 --- a/menu.sh +++ b/menu.sh @@ -1508,14 +1508,19 @@ EOF [[ $CONFIRM = [Yy] ]] && teams_change && echo "$TEAMS" > /etc/wireguard/info.log 2>&1 # 设置开机启动 - ${SYSTEMCTL_ENABLE[int]}>/dev/null 2>&1 + ${SYSTEMCTL_ENABLE[int]} >/dev/null 2>&1 type -p dnsmasq >/dev/null 2>&1 && systemctl restart dnsmasq >/dev/null 2>&1 # Linux 内核低于5.6的,安装 Wireguard-GO。部分较低内核版本的KVM,即使安装了wireguard-dkms, 仍不能正常工作,兜底使用 wireguard-go - ([[ $WG = 1 ]] || [[ $(systemctl is-active wg-quick@wgcf) != active ]] || [[ $(systemctl is-enabled wg-quick@wgcf) != enabled ]]) && - wget --no-check-certificate $CDN -N https://raw.githubusercontent.com/fscarmen/warp/main/wireguard-go/wireguard-go_linux_"$ARCHITECTURE".tar.gz && - tar xzf wireguard-go_linux_$ARCHITECTURE.tar.gz -C /usr/bin/ && rm -f wireguard-go_linux_* && chmod +x /usr/bin/wireguard-go - + if [[ $SYSTEM != Alpine ]]; then + if [[ $WG = 1 ]] || [[ $(systemctl is-active wg-quick@wgcf) != active ]] || [[ $(systemctl is-enabled wg-quick@wgcf) != enabled ]]; then + systemctl disable --now wg-quick@wgcf + sleep 3 + wget --no-check-certificate $CDN -N https://raw.githubusercontent.com/fscarmen/warp/main/wireguard-go/wireguard-go_linux_"$ARCHITECTURE".tar.gz && + tar xzf wireguard-go_linux_$ARCHITECTURE.tar.gz -C /usr/bin/ && rm -f wireguard-go_linux_* && chmod +x /usr/bin/wireguard-go + ${SYSTEMCTL_ENABLE[int]} >/dev/null 2>&1 + fi + fi # 保存好配置文件 mv -f wgcf-account.toml wgcf-profile.conf menu.sh /etc/wireguard >/dev/null 2>&1