Update CFwarp.sh

This commit is contained in:
rkygogo 2022-06-24 21:39:15 +08:00 committed by GitHub
parent 15d9e7f518
commit 840fb953ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -86,9 +86,9 @@ fi
[[ ! $(type -P python3) ]] && (yellow "检测到python3未安装升级安装中" && $yumapt update;$yumapt install python3)
[[ ! $(type -P screen) ]] && (yellow "检测到screen未安装升级安装中" && $yumapt update;$yumapt install screen)
ud4='sed -i "4 s/^/PostUp = ip -4 rule add from '$(ip route get 162.159.193.1 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/;5 s/^/PostDown = ip -4 rule delete from '$(ip route get 162.159.193.1 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/" /etc/wireguard/wgcf.conf'
ud6='sed -i "6 s/^/PostUp = ip -6 rule add from '$(ip route get 2606:4700:d0::a29f:c001 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/;7 s/^/PostDown = ip -6 rule delete from '$(ip route get 2606:4700:d0::a29f:c001 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/" /etc/wireguard/wgcf.conf'
ud4ud6='sed -i "4 s/^/PostUp = ip -4 rule add from '$(ip route get 162.159.193.1 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/;5 s/^/PostDown = ip -4 rule delete from '$(ip route get 162.159.193.1 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/;6 s/^/PostUp = ip -6 rule add from '$(ip route get 2606:4700:d0::a29f:c001 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/;7 s/^/PostDown = ip -6 rule delete from '$(ip route get 2606:4700:d0::a29f:c001 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/" /etc/wireguard/wgcf.conf'
ud4='sed -i "7 s/^/PostUp = ip -4 rule add from '$(ip route get 162.159.193.1 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/;7 s/^/PostDown = ip -4 rule delete from '$(ip route get 162.159.193.1 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/" /etc/wireguard/wgcf.conf'
ud6='sed -i "7 s/^/PostUp = ip -6 rule add from '$(ip route get 2606:4700:d0::a29f:c001 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/;7 s/^/PostDown = ip -6 rule delete from '$(ip route get 2606:4700:d0::a29f:c001 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/" /etc/wireguard/wgcf.conf'
ud4ud6='sed -i "7 s/^/PostUp = ip -4 rule add from '$(ip route get 162.159.193.1 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/;7 s/^/PostDown = ip -4 rule delete from '$(ip route get 162.159.193.1 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/;7 s/^/PostUp = ip -6 rule add from '$(ip route get 2606:4700:d0::a29f:c001 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/;7 s/^/PostDown = ip -6 rule delete from '$(ip route get 2606:4700:d0::a29f:c001 2>/dev/null | grep -oP 'src \K\S+')' lookup main\n/" /etc/wireguard/wgcf.conf'
c1="sed -i '/0\.0\.0\.0\/0/d' /etc/wireguard/wgcf.conf"
c2="sed -i '/\:\:\/0/d' /etc/wireguard/wgcf.conf"
c3="sed -i 's/engage.cloudflareclient.com/162.159.193.10/g' /etc/wireguard/wgcf.conf"