SSID Exclusions
Closed this issue · 5 comments
When you generate the exclusion list, it appears that order matters quite a bit.
With the generator it'll spit out the following for "On wifi only":
<key>OnDemandRules</key> <array> <dict> <key>InterfaceTypeMatch</key> <string>WiFi</string> <key>Action</key> <string>Connect</string> </dict> <dict> <!-- VPN Default state --> <key>Action</key> <string>Disconnect</string> </dict> <dict> <key>InterfaceTypeMatch</key> <string>WiFi</string> <key>SSIDMatch</key> <array> <string> SSID_EXCLUSION_HERE </string> </array> <key>Action</key> <string>Disconnect</string> </dict> </array>
It needs to be changed to:
<key>OnDemandRules</key> <array> <dict> <key>InterfaceTypeMatch</key> <string>WiFi</string> <key>SSIDMatch</key> <array> <string> SSID_EXCLUSION_HERE </string> </array> <key>Action</key> <string>Disconnect</string> </dict> <dict> <key>InterfaceTypeMatch</key> <string>WiFi</string> <key>Action</key> <string>Connect</string> </dict> <dict> <!-- VPN Default state --> <key>Action</key> <string>Disconnect</string> </dict> </array>
If you move the autoconnect IF statements below the if (ssids && autoconnect !== 'none'){ ... }
it generates properly.
@Xaositek I tried rearranging the lines and SSID exclusion is still not working for me. Does it work for you?
Look at my other issue - it's due to the line breaks you coded in. Both these items together should make it work correctly.