# $FreeWRT$
#
# This file is part of the FreeWRT project. FreeWRT is copyrighted
# material, please see the LICENCE file in the top-level directory
# or at http://www.freewrt.org/licence for details.
#
# Christian Fischer <spaetzle@freewrt.org>
#

. /opt/ifupdown/bin/mprint.sh


mstart() {
	mprint -d "Starting $IFACE_TYPE $IFACE"
	MDENT=$(expr ${MDENT:-0} + 1)
	pos_update
}

mstop() {
	mprint -d "Stopping $IFACE_TYPE $IFACE"
	MDENT=$(expr ${MDENT:-0} + 1)
	pos_update
}

mup() {
	mprint -n "Bringing up $IFACE_TYPE $IFACE"
}

mdown() {
	mprint -n "Bringing down $IFACE_TYPE $IFACE"
}

madd() {
	mprint -n "Adding ${1:-$IFACE}"
}

mremove() {
	mprint -n "Removing ${1:-$IFACE}"
}

mcreate() {
	mprint -n "Creating ${2:-$IFACE_TYPE} ${1:-$IFACE}"
}
mdestroy() {
	mprint -n "Destroying ${2:-$IFACE_TYPE} ${1:-$IFACE}"
}

merr() {
	mprint "${HILITE}" "Error: ${@}"
}

minfo() {
	mprint "${HILITE}" "Info: ${@}"
}

mwarn() {
	mprint "${HILITE}" "Warning: ${@}"
}

mstate() {
	mprint -e $1
	return $1
}


# vim:ts=4
