1
0
mirror of synced 2024-11-22 21:16:02 +03:00

Update IKEv2 script

- Improve the optional VPN On Demand feature on macOS and iOS.
  Connect only on WiFi networks (instead of any network), with
  captive portal detection. This is the most common use case.
This commit is contained in:
hwdsl2 2022-10-30 15:45:11 -05:00
parent cbd356ac1a
commit edd05df89c

View File

@ -157,7 +157,7 @@ confirm_or_abort() {
show_header() { show_header() {
cat <<'EOF' cat <<'EOF'
IKEv2 Script Copyright (c) 2020-2022 Lin Song 22 Oct 2022 IKEv2 Script Copyright (c) 2020-2022 Lin Song 30 Oct 2022
EOF EOF
} }
@ -932,9 +932,23 @@ cat > "$mc_file" <<EOF
<key>OnDemandRules</key> <key>OnDemandRules</key>
<array> <array>
<dict> <dict>
<key>InterfaceTypeMatch</key>
<string>WiFi</string>
<key>URLStringProbe</key>
<string>http://captive.apple.com/hotspot-detect.html</string>
<key>Action</key> <key>Action</key>
<string>Connect</string> <string>Connect</string>
</dict> </dict>
<dict>
<key>InterfaceTypeMatch</key>
<string>Cellular</string>
<key>Action</key>
<string>Disconnect</string>
</dict>
<dict>
<key>Action</key>
<string>Ignore</string>
</dict>
</array> </array>
<key>RemoteAddress</key> <key>RemoteAddress</key>
<string>$server_addr</string> <string>$server_addr</string>