2009-05-01 19:41:40 +05:30
|
|
|
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
|
2011-06-30 05:16:31 +05:30
|
|
|
# Released under the 2-clause BSD license.
|
2007-11-14 20:52:04 +05:30
|
|
|
|
2008-01-11 20:38:57 +05:30
|
|
|
br2684ctl_depend()
|
|
|
|
{
|
2007-04-05 16:48:42 +05:30
|
|
|
before ppp
|
2012-01-09 05:54:03 +05:30
|
|
|
program start br2684ctl
|
2007-04-05 16:48:42 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
_config_vars="$_config_vars bridge bridge_add brctl"
|
2011-01-17 15:19:07 +05:30
|
|
|
|
2008-01-11 20:38:57 +05:30
|
|
|
br2684ctl_pre_start()
|
|
|
|
{
|
2007-04-05 16:48:42 +05:30
|
|
|
local opts=
|
|
|
|
eval opts=\$br2684ctl_${IFVAR}
|
|
|
|
[ -z "${opts}" ] && return 0
|
|
|
|
|
2007-11-28 21:15:03 +05:30
|
|
|
if [ "${IFACE#nas[0-9]*}" = "${IFACE}" ]; then
|
2007-04-05 16:48:42 +05:30
|
|
|
eerror "Interface must be called nas[0-9] for RFC 2684 Bridging"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
case " ${opts} " in
|
|
|
|
*" -b "*|*" -c "*)
|
|
|
|
eerror "The -b and -c options are not allowed for br2684ctl_${IVAR}"
|
|
|
|
return 1
|
|
|
|
;;
|
2007-11-28 21:15:03 +05:30
|
|
|
*" -a "*);;
|
2007-04-05 16:48:42 +05:30
|
|
|
*)
|
|
|
|
eerror "-a option (VPI and VCI) is required in br2684ctl_${IFVAR}"
|
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
esac
|
2011-01-17 15:19:07 +05:30
|
|
|
|
2007-04-05 16:48:42 +05:30
|
|
|
einfo "Starting RFC 2684 Bridge control on ${IFACE}"
|
2012-01-09 05:54:03 +05:30
|
|
|
start-stop-daemon --start --exec $(_which br2684ctl) --background \
|
2007-04-05 16:48:42 +05:30
|
|
|
--make-pidfile --pidfile "/var/run/br2684ctl-${IFACE}.pid" \
|
|
|
|
-- -c "${IFACE#nas*}" ${opts}
|
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
2008-01-11 20:38:57 +05:30
|
|
|
br2684ctl_post_stop()
|
|
|
|
{
|
2007-04-05 16:48:42 +05:30
|
|
|
local pidfile="/var/run/br2684ctl-${IFACE}.pid"
|
|
|
|
[ -e "${pidfile}" ] || return 0
|
2011-01-17 15:19:07 +05:30
|
|
|
|
2007-04-05 16:48:42 +05:30
|
|
|
einfo "Stopping RFC 2684 Bridge control on ${IFACE}"
|
2008-01-04 01:32:27 +05:30
|
|
|
start-stop-daemon --stop --quiet --pidfile "${pidfile}"
|
2007-04-05 16:48:42 +05:30
|
|
|
eend $?
|
|
|
|
}
|