ansible-roles/vpn/base/templates/ifupdown.sh

22 lines
575 B
Bash
Raw Normal View History

2023-08-10 16:34:04 +02:00
#!/usr/bin/env bash
# Do not run if the deprecated bridge scripts are present.
if [ -f "$(dirname ${0})/bridge" ]
then
echo "$(basename ${0}):"\
"ifupdown scripts from bridge-utils interfere with the-nine-worlds scripts" 1>&2
exit 1
fi
IFDIR={{ system_etc_root_directory }}/network/interfaces/${IFACE}
IFUPDIR=${IFDIR}/ifup.d
IFDOWNDIR=${IFDIR}/ifdown.d
if [ "${MODE}" == "start" ] && [ -d ${IFUPDIR} ]
then
/bin/run-parts --exit-on-error ${IFUPDIR}
elif [ "${MODE}" == "stop" ] && [ -d ${IFDOWNDIR} ]
then
/bin/run-parts --reverse ${IFDOWNDIR}
fi