summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2019-02-19 00:27:45 +0100
committerDavid Lamparter <equinox@diac24.net>2019-02-19 21:38:23 +0100
commit195f215cfc470ea23e981961f9febd735febb4cf (patch)
treea4446dca87e4555e218ba6452e20dcd05f0cab12 /tools
parentdoc: update for new daemons settings (diff)
downloadfrr-195f215cfc470ea23e981961f9febd735febb4cf.tar.xz
frr-195f215cfc470ea23e981961f9febd735febb4cf.zip
tools: fix new init script wrt. multi-instance
TBH when I looked at watchfrr I didn't see any MI support and hence assumed this just didn't work to begin with. However, it actually does (transparently to watchfrr, by just using "ospfd-1" as daemon name.) So, fix this up and make it work again. (Also remove 2 extraneous \n in messages.) Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/frrcommon.sh.in13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/frrcommon.sh.in b/tools/frrcommon.sh.in
index fa2fdc94b..065295f52 100644
--- a/tools/frrcommon.sh.in
+++ b/tools/frrcommon.sh.in
@@ -67,9 +67,9 @@ vtysh_b () {
daemon_inst() {
# note this sets global variables ($dmninst, $daemon, $inst)
dmninst="$1"
- daemon="${dmninst%:*}"
+ daemon="${dmninst%-*}"
inst=""
- [ "$daemon" != "$dmninst" ] && inst="${dmninst#*:}"
+ [ "$daemon" != "$dmninst" ] && inst="${dmninst#*-}"
}
daemon_list() {
@@ -89,9 +89,12 @@ daemon_list() {
enabled="$enabled $daemon"
if [ -n "$inst" ]; then
debug "$daemon multi-instance $inst"
+ oldifs="${IFS}"
+ IFS="${IFS},"
for i in $inst; do
- enabled="$enabled $daemon:$inst"
+ enabled="$enabled $daemon-$i"
done
+ IFS="${oldifs}"
fi
else
debug "$daemon disabled"
@@ -116,7 +119,7 @@ daemon_prep() {
inst="$2"
[ "$daemon" = "watchfrr" ] && return 0
[ -x "$D_PATH/$daemon" ] || {
- log_failure_msg "cannot start $daemon${inst:+ (instance $inst)}: daemon binary not installed\n"
+ log_failure_msg "cannot start $daemon${inst:+ (instance $inst)}: daemon binary not installed"
return 1
}
[ -r "$C_PATH/frr.conf" ] && return 0
@@ -276,7 +279,7 @@ load_old_config() {
}
[ -r "$C_PATH/daemons" ] || {
- log_failure_msg "cannot run $@: $C_PATH/daemons does not exist\n"
+ log_failure_msg "cannot run $@: $C_PATH/daemons does not exist"
exit 1
}
. "$C_PATH/daemons"