#!/bin/vbash
source /opt/vyatta/etc/functions/script-template

if [ "$(id -g -n)" != 'vyattacfg' ] ; then
    exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@"
fi

# Configuration items start here
configure

{% for ifdata in interfaces|default([]) if ifdata.vlan is defined %}
{% if ifdata.vlan.access_id is defined %}
set interfaces bridge br0 member interface {{ ifdata.ifname }} native-vlan {{ ifdata.vlan.access_id }}
{% endif %}
{% endfor %}

# Commit, save and exit from subshell

commit
save
exit
