mirror of https://gitlab.com/rwkgyg/CFwarp.git
Update CFwarp.sh
This commit is contained in:
parent
99fe5594dd
commit
15d9e7f518
|
@ -85,10 +85,7 @@ 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)
|
||||
L46(){
|
||||
L6=$(ip route get 2606:4700:d0::a29f:c001 2>/dev/null | grep -oP 'src \K\S+')
|
||||
L4=$(ip route get 162.159.193.1 2>/dev/null | grep -oP 'src \K\S+')
|
||||
}
|
||||
|
||||
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'
|
||||
|
|
Loading…
Reference in New Issue