Update CFwarp.sh

This commit is contained in:
rkygogo 2022-06-24 18:13:10 +08:00 committed by GitHub
parent 2e3793e128
commit dea4cc6bd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -85,7 +85,9 @@ fi
[[ $(type -P curl) ]] || (yellow "检测到curl未安装升级安装中" && $yumapt update;$yumapt install curl)
[[ ! $(type -P python3) ]] && (yellow "检测到python3未安装升级安装中" && $yumapt update;$yumapt install python3)
[[ ! $(type -P screen) ]] && (yellow "检测到screen未安装升级安装中" && $yumapt update;$yumapt install screen)
L6=$(ip route get 2606:4700:d0::a29f:c001 | grep -oP 'src \K\S+')
L4=$(ip route get 162.159.193.1 | grep -oP 'src \K\S+')
ud4='sed -i "5 s/^/PostUp = ip -4 rule add from $(ip route get 162.159.193.1 | grep -oP 'src \K\S+') lookup main\n/;6 s/^/PostDown = ip -4 rule delete from $(ip route get 162.159.193.1 | 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 | grep -oP 'src \K\S+') lookup main\n/;8 s/^/PostDown = ip -6 rule delete from $(ip route get 2606:4700:d0::a29f:c001 | grep -oP 'src \K\S+') lookup main\n/" /etc/wireguard/wgcf.conf'
ud4ud6='sed -i "5 s/^/PostUp = ip -4 rule add from $(ip route get 162.159.193.1 | grep -oP 'src \K\S+') lookup main\n/;6 s/^/PostDown = ip -4 rule delete from $(ip route get 162.159.193.1 | grep -oP 'src \K\S+') lookup main\n/;7 s/^/PostUp = ip -6 rule add from $(ip route get 2606:4700:d0::a29f:c001 | grep -oP 'src \K\S+') lookup main\n/;8 s/^/PostDown = ip -6 rule delete from $(ip route get 2606:4700:d0::a29f:c001 | grep -oP 'src \K\S+') lookup main\n/" /etc/wireguard/wgcf.conf'