Page MenuHomeVyOS Platform

service-override.conf.j2
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

service-override.conf.j2

{% set options = namespace(value='') %}
{% if openvpn_option is vyos_defined %}
{% for option in openvpn_option %}
{# Remove the '--' prefix from variable if it is presented #}
{% if option.startswith('--') %}
{% set option = option.split('--', maxsplit=1)[1] %}
{% endif %}
{# Workaround to pass '--push' options properly. Previously openvpn accepted this option without values in double-quotes #}
{# But now it stopped doing this, so we need to add them for compatibility #}
{# HOWEVER! This is a raw option and we do not promise that this or any other trick will work for all the cases. #}
{# Using 'openvpn-option' you take all responsibility for compatibility for yourself. #}
{% if option.startswith('push') and not (option.startswith('push "') and option.endswith('"')) %}
{% set option = 'push \"%s\"' | format(option.split('push ', maxsplit=1)[1]) %}
{% endif %}
{% set options.value = options.value ~ ' --' ~ option %}
{% endfor %}
{% endif %}
[Service]
ExecStart=
ExecStart=/usr/sbin/openvpn --daemon openvpn-%i --config %i.conf --status %i.status 30 --writepid %i.pid {{ options.value }}

File Metadata

Mime Type
text/plain
Expires
Sat, Sep 26, 10:15 AM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4284918
Default Alt Text
service-override.conf.j2 (1 KB)

Event Timeline