|
|
@ -20,10 +20,12 @@ |
|
|
|
# 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() { |
|
|
@ -38,10 +40,10 @@ configure_tap_up() { |
|
|
|
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 \ |
|
|
@ -53,35 +55,16 @@ start_cable_pre_up() { |
|
|
|
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 |
|
|
|