## **************************************************************************
## For copyright and licensing terms, see the file named COPYING.
## **************************************************************************

[Unit]
Description=Network configuration for interface %I
Wants=%p-log.service
After=%p-log.service
PartOf=netif@%i

[Service]
EnvironmentDirectory=env
ExecStartPre=sh -c 'test -n "${create_opts}" && /bin/exec %p '"'%I'"' create ${create_opts}'
ExecStartPre=sh -c 'test -n "${link_opts}" && /bin/exec %p '"'%I'"' link ${link_opts}'
ExecStartPre=sh -c 'test -n "${inet6_opts}" && /bin/exec %p '"'%I'"' inet6 ${inet6_opts}'
ExecStartPre=sh -c 'test -n "${inet4_opts}" && /bin/exec %p '"'%I'"' inet ${inet4_opts}'
ExecStartPre=%p '%I' inet up
ExecStartPre=sh -c 'printenv link_aliases | while read -r a ; do /bin/exec %p '"'%I'"' link ${a} alias ; done'
ExecStartPre=sh -c 'printenv inet6_aliases | while read -r a ; do /bin/exec %p '"'%I'"' inet6 ${a} alias ; done'
ExecStartPre=sh -c 'printenv inet4_aliases | while read -r a ; do /bin/exec %p '"'%I'"' inet ${a} alias ; done'
ExecStopPost=sh -c 'printenv inet4_aliases | while read -r a ; do /bin/exec %p '"'%I'"' inet ${a} -alias ; done'
ExecStopPost=sh -c 'printenv inet6_aliases | while read -r a ; do /bin/exec %p '"'%I'"' inet6 ${a} -alias ; done'
ExecStopPost=sh -c 'printenv link_aliases | while read -r a ; do /bin/exec %p '"'%I'"' link ${a} -alias ; done'
ExecStopPost=%p '%I' inet down
ExecStopPost=%p '%I' inet6 -accept_rtadv ifdisabled
ExecStopPost=sh -c 'test -n "${create_opts}" && /bin/exec %p -n '"'%I'"' destroy'
RemainAfterExit=true

[Install]
WantedBy=netif@%i
