mirror of
https://gitlab.com/fscarmen/warp.git
synced 2026-06-15 03:25:42 +08:00
Fix some bugs.
Former-commit-id: 7b4e8869b998db2538e2d01d559d0ea83355830b
This commit is contained in:
@@ -463,8 +463,8 @@ check_dependencies() {
|
||||
if [ "$SYSTEM" = Alpine ]; then
|
||||
[ ! -e /etc/wireguard/menu.sh ] && ( ${PACKAGE_UPDATE[int]}; ${PACKAGE_INSTALL[int]} curl wget grep bash )
|
||||
else
|
||||
DEPS_CHECK=("ping" "wget" "curl" "systemctl" "ip")
|
||||
DEPS_INSTALL=("iputils-ping" "wget" "curl" "systemctl" "iproute2")
|
||||
DEPS_CHECK=("ping" "wget" "curl" "systemctl" "ip" "python3")
|
||||
DEPS_INSTALL=("iputils-ping" "wget" "curl" "systemctl" "iproute2" "python3")
|
||||
for ((g=0; g<${#DEPS_CHECK[@]}; g++)); do [ ! $(type -p ${DEPS_CHECK[g]}) ] && [[ ! "${DEPS[@]}" =~ "${DEPS_INSTALL[g]}" ]] && DEPS+=(${DEPS_INSTALL[g]}); done
|
||||
if [ "${#DEPS[@]}" -ge 1 ]; then
|
||||
info "\n $(text 7) ${DEPS[@]} \n"
|
||||
@@ -1024,7 +1024,7 @@ uninstall() {
|
||||
systemctl disable --now wg-quick@warp >/dev/null 2>&1; sleep 3
|
||||
[ $(type -p rpm) ] && rpm -e wireguard-tools 2>/dev/null
|
||||
systemctl restart systemd-resolved >/dev/null 2>&1; sleep 3
|
||||
bash <(curl -m5 -sSL https://raw.githubusercontent.com/fscarmen/warp/main/api.sh) --file /etc/wireguard/warp-account.conf --cancle >/dev/null 2>&1
|
||||
grep -qs 'id' /etc/wireguard/warp-account.conf && bash <(curl -m5 -sSL https://raw.githubusercontent.com/fscarmen/warp/main/api.sh) --file /etc/wireguard/warp-account.conf --cancle >/dev/null 2>&1
|
||||
rm -rf /usr/bin/wireguard-go /usr/bin/warp /etc/dnsmasq.d/warp.conf /usr/bin/wireproxy /etc/local.d/warp.start
|
||||
[ -e /etc/gai.conf ] && sed -i '/^precedence \:\:ffff\:0\:0/d;/^label 2002\:\:\/16/d' /etc/gai.conf
|
||||
[ -e /usr/bin/tun.sh ] && rm -f /usr/bin/tun.sh
|
||||
@@ -1079,7 +1079,7 @@ uninstall() {
|
||||
|
||||
# 删除本脚本安装在 /etc/wireguard/ 下的所有文件,如果删除后目录为空,一并把目录删除
|
||||
rm -f /etc/wireguard/{wgcf-account.conf,wgcf.conf.bak,wgcf.conf,warp-temp.conf,warp-account.conf,warp_unlock.sh,warp.conf.bak,warp.conf,up,proxy.conf.bak,proxy.conf,menu.sh,license,language,info-temp.log,info.log,down,account-temp.conf}
|
||||
[ -z "$(ls -A /etc/wireguard/)" ] && rmdir /etc/wireguard
|
||||
[[ -e /etc/wireguard && -z "$(ls -A /etc/wireguard/)" ]] && rmdir /etc/wireguard
|
||||
|
||||
# 选择自动卸载依赖执行以下
|
||||
[[ "$UNINSTALL_DEPENDENCIES_LIST" != '' && "$CONFIRM_UNINSTALL" = [Yy] ]] && ( ${PACKAGE_UNINSTALL[int]} $UNINSTALL_DEPENDENCIES_LIST 2>/dev/null; info " $(text 171) \n" )
|
||||
|
||||
Reference in New Issue
Block a user