projects
/
rrq
/
rrqnet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changed "renice" to "nice"
[rrq/rrqnet.git]
/
rrqnet-ifupdown.sh
diff --git
a/rrqnet-ifupdown.sh
b/rrqnet-ifupdown.sh
index 6c33d5fa38aeb50dda9374eb30333e327926cf8c..336c46d4980b021ae8106fb0d46e15090b7e9984 100755
(executable)
--- a/
rrqnet-ifupdown.sh
+++ b/
rrqnet-ifupdown.sh
@@
-19,11
+19,14
@@
# An rrqnet stanza may have the following settings:
# rrqnet_port <port>
# An rrqnet stanza may have the following settings:
# rrqnet_port <port>
+# rrqnet_nice <nice>
# rrqnet_remote <remote declaration>
# rrqnet_remote <remote declaration>
-# rrqnet_
bridge <bridge
>
+# rrqnet_
options <options
>
# rrqnet_log <level> <pathname>
# rrqnet_log <level> <pathname>
+# rrqnet_bridge <bridge>
: ${RRQDAEMON:=/usr/local/sbin/rrqnet}
: ${RRQDAEMON:=/usr/local/sbin/rrqnet}
+: ${NAME:=rrqnet-${IFACE}}
#function
configure_tap_bridge() {
#function
configure_tap_bridge() {
@@
-38,14
+41,16
@@
configure_tap_up() {
grep -q "state UP" || ip link set dev $IFACE up
}
grep -q "state UP" || ip link set dev $IFACE up
}
-#function
<env> start_cable <loglevel> <logfile>
+#function
start_cable_pre_up() {
start_cable_pre_up() {
- configure_tap_up
- NAME="rrqnet-$IFACE"
+ configure_tap_up || return 1
+ configure_tap_bridge || return 1
+ [ -z "$IF_RRQNET_NICE" ] || \
+ RRQDAEMON="/usr/bin/nice -n $IF_RRQNET_NICE $RRQDAEMON"
if [ -z "$IF_RRQNET_LOG" ] ; then
daemon -U -r -n $NAME -- \
$RRQDAEMON $IF_RRQNET_OPTIONS \
if [ -z "$IF_RRQNET_LOG" ] ; then
daemon -U -r -n $NAME -- \
$RRQDAEMON $IF_RRQNET_OPTIONS \
- -t $IFACE $IF_RRQNET $IF_RRQNET_REMOTE
+ -t $IFACE $IF_RRQNET
_PORT
$IF_RRQNET_REMOTE
else
daemon -U -r -n $NAME -E "${IF_RRQNET_LOG#* }" -- \
$RRQDAEMON ${IF_RRQNET_LOG%% *} $IF_RRQNET_OPTIONS \
else
daemon -U -r -n $NAME -E "${IF_RRQNET_LOG#* }" -- \
$RRQDAEMON ${IF_RRQNET_LOG%% *} $IF_RRQNET_OPTIONS \
@@
-53,35
+58,16
@@
start_cable_pre_up() {
fi
}
fi
}
-#function
-start_cable_post_up() {
- configure_tap_bridge
-}
-
-#function
-stop_cable_pre_down() {
- :
-}
-
#function
stop_cable_post_down() {
#function
stop_cable_post_down() {
- NAME="rrqnet-$IFACE"
daemon -n $NAME --stop
}
# main script body
case "$MODE-$PHASE" in
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
esac