]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tools: Modify all_stop to actually try to stop all daemons
authorDonald Sharp <sharpd@nvidia.com>
Tue, 29 Mar 2022 21:47:48 +0000 (17:47 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 30 Mar 2022 11:44:31 +0000 (07:44 -0400)
If a user enters:
/usr/lib/frr/frrinit.sh start
<modifies daemons file to remove a daemon from being used>
then calls:
/usr/lib/frr/frrinit.sh stop

The daemon(s) that are removed from the file are not stopped.

Apparently in shell scripting naming the variables the same
as the callee does not work as one would think.  Just renaming
the variable to something else solved the problem.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tools/frrcommon.sh.in

index d95f2d4be7ac1ca3e7b092c00a13c61dd970aad0..52f5277d2511e622152358654faeb8064c876654 100644 (file)
@@ -253,11 +253,11 @@ all_start() {
 all_stop() {
        local pids reversed
 
-       daemon_list daemons disabled
-       [ "$1" = "--reallyall" ] && daemons="$daemons $disabled"
+       daemon_list enabled_daemons disabled_daemons
+       [ "$1" = "--reallyall" ] && enabled_daemons="$enabled_daemons $disabled_daemons"
 
        reversed=""
-       for dmninst in $daemons; do
+       for dmninst in $enabled_daemons; do
                reversed="$dmninst $reversed"
        done