# An rrqnet stanza may have the following settings:
# rrqnet_port <port>
# rrqnet_remote <remote declaration>
-# rrqnet_bridge <bridge>
+# rrqnet_options <options>
# rrqnet_log <level> <pathname>
+# rrqnet_bridge <bridge>
: ${RRQDAEMON:=/usr/local/sbin/rrqnet}
+: ${NAME:=rrqnet-${IFACE}}
#function
configure_tap_bridge() {
grep -q "state UP" || ip link set dev $IFACE up
}
-#function <env> start_cable <loglevel> <logfile>
+#function
start_cable_pre_up() {
- configure_tap_up
- NAME="rrqnet-$IFACE"
+ configure_tap_up || return 1
+ configure_tap_bridge || return 1
if [ -z "$IF_RRQNET_LOG" ] ; then
daemon -U -r -n $NAME -- \
$RRQDAEMON $IF_RRQNET_OPTIONS \
fi
}
-#function
-start_cable_post_up() {
- configure_tap_bridge
-}
-
-#function
-stop_cable_pre_down() {
- :
-}
-
#function
stop_cable_post_down() {
- NAME="rrqnet-$IFACE"
daemon -n $NAME --stop
}
# main script body
case "$MODE-$PHASE" in
- start-pre-up)
- start_cable_pre_up
- ;;
- start-post-up)
- start_cable_post_up
- ;;
- stop-pre-down)
- :
- ;;
- stop-post-down)
- stop_cable_post_down
- ;;
+ start-pre-up) start_cable_pre_up ;;
+ start-post-up) : ;;
+ stop-pre-down) : ;;
+ stop-post-down) stop_cable_post_down ;;
esac