From 53f3f3e3303bb46e54396deda2e18e08c3c956c6 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Mon, 5 Oct 2020 23:37:08 +1100 Subject: [PATCH] simplified --- rrqnet-ifupdown.sh | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/rrqnet-ifupdown.sh b/rrqnet-ifupdown.sh index 6c33d5f..cdfd3b4 100755 --- a/rrqnet-ifupdown.sh +++ b/rrqnet-ifupdown.sh @@ -20,10 +20,12 @@ # An rrqnet stanza may have the following settings: # rrqnet_port # rrqnet_remote -# rrqnet_bridge +# rrqnet_options # rrqnet_log +# rrqnet_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 start_cable +#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 -- 2.39.2