Simplify Apple Profile Configuration Template

This commit is contained in:
Fabian Foerg 2018-12-12 22:07:29 -08:00
parent 58ce62e2bd
commit c70dd01bb2

View file

@ -7,13 +7,13 @@
<dict> <dict>
<key>IKEv2</key> <key>IKEv2</key>
<dict> <dict>
{% if algo_ondemand_wifi or algo_ondemand_cellular %} {%- if algo_ondemand_wifi or algo_ondemand_cellular %}
<key>OnDemandEnabled</key> <key>OnDemandEnabled</key>
<integer>1</integer> <integer>1</integer>
<key>OnDemandRules</key> <key>OnDemandRules</key>
<array> <array>
{% if algo_ondemand_wifi_exclude|b64decode != '_null' %} {%- if algo_ondemand_wifi_exclude|b64decode != '_null' %}
{% set WIFI_EXCLUDE_LIST = (algo_ondemand_wifi_exclude|b64decode|string).split(',') %} {%- set WIFI_EXCLUDE_LIST = (algo_ondemand_wifi_exclude|b64decode|string).split(',') %}
<dict> <dict>
<key>Action</key> <key>Action</key>
<string>Disconnect</string> <string>Disconnect</string>
@ -21,20 +21,19 @@
<string>WiFi</string> <string>WiFi</string>
<key>SSIDMatch</key> <key>SSIDMatch</key>
<array> <array>
{% for network_name in WIFI_EXCLUDE_LIST %} {%- for network_name in WIFI_EXCLUDE_LIST %}
<string>{{ network_name|e }}</string> <string>{{ network_name|e }}</string>
{% endfor %} {%- endfor %}
</array> </array>
</dict> </dict>
{% else %} {%- endif %}
{% endif %}
<dict> <dict>
<key>Action</key> <key>Action</key>
{% if algo_ondemand_wifi %} {%- if algo_ondemand_wifi %}
<string>Connect</string> <string>Connect</string>
{% else %} {%- else %}
<string>Disconnect</string> <string>Disconnect</string>
{% endif %} {%- endif %}
<key>InterfaceTypeMatch</key> <key>InterfaceTypeMatch</key>
<string>WiFi</string> <string>WiFi</string>
<key>URLStringProbe</key> <key>URLStringProbe</key>
@ -42,11 +41,11 @@
</dict> </dict>
<dict> <dict>
<key>Action</key> <key>Action</key>
{% if algo_ondemand_cellular %} {%- if algo_ondemand_cellular %}
<string>Connect</string> <string>Connect</string>
{% else %} {%- else %}
<string>Disconnect</string> <string>Disconnect</string>
{% endif %} {%- endif %}
<key>InterfaceTypeMatch</key> <key>InterfaceTypeMatch</key>
<string>Cellular</string> <string>Cellular</string>
<key>URLStringProbe</key> <key>URLStringProbe</key>
@ -57,8 +56,7 @@
<string>Disconnect</string> <string>Disconnect</string>
</dict> </dict>
</array> </array>
{% else %} {%- endif %}
{% endif %}
<key>AuthenticationMethod</key> <key>AuthenticationMethod</key>
<string>Certificate</string> <string>Certificate</string>
<key>ChildSecurityAssociationParameters</key> <key>ChildSecurityAssociationParameters</key>