From ba117367612c347f4112398488b36cad94dd5e2d Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 18 Aug 2017 10:57:07 -0400 Subject: [PATCH] tools: Always ensure that the daemon exists at startup When starting up FRR with tools/frr, ensure that the daemon specified that we are about to start actually exists. Signed-off-by: Donald Sharp --- tools/frr | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/frr b/tools/frr index 0bea3ee81d..4eb4a5c28c 100755 --- a/tools/frr +++ b/tools/frr @@ -72,6 +72,11 @@ vtysh_b () # returns: 0=ok, 1=error check_daemon() { + if [ $1 != "watchfrr" -a $1 != "vtysh_enable" ]; then + # check for daemon binary + if [ ! -x "$D_PATH/$1" ]; then return 1; fi + fi + # If the integrated config file is used the others are not checked. if [ -r "$C_PATH/frr.conf" ]; then return 0 @@ -80,9 +85,6 @@ check_daemon() # vtysh_enable has no config file nor binary so skip check. # (Not sure why vtysh_enable is in this list but does not hurt) if [ $1 != "watchfrr" -a $1 != "vtysh_enable" ]; then - # check for daemon binary - if [ ! -x "$D_PATH/$1" ]; then return 1; fi - # check for config file if [ -n "$2" ]; then if [ ! -r "$C_PATH/$1-$2.conf" ]; then -- 2.39.5