22 lines
575 B
Bash
22 lines
575 B
Bash
|
#!/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
|