From: Donald Sharp Date: Fri, 18 Aug 2017 14:57:07 +0000 (-0400) Subject: tools: Always ensure that the daemon exists at startup X-Git-Tag: frr-4.0-dev~391^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=ba117367612c347f4112398488b36cad94dd5e2d;p=matthieu%2Ffrr.git 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 --- 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