From 88eab6757aeedb265f1b6ff53c3bdb18be958c1a Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Sat, 12 Nov 2016 09:26:07 -0800 Subject: [PATCH] Fix broken logic for detecting if executable exists Code was checking if $(executable) was executable. But $(executable) would run the executable and get the output from the executable. This output was not the path to the executable. Fix this and also use correct name for iptables-save (was iptable-save) Change-Id: Ie2ccd405cd01acea7201a199b4c8c12922e46e4f --- save-state | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/save-state b/save-state index d363a3b5..7ddb409d 100755 --- a/save-state +++ b/save-state @@ -47,11 +47,11 @@ save_data $BASE_RELEASE $BASE_DEVSTACK_DIR # Save ebtables/iptables # ---------------------- -# NOTE(sileht): If nova is not installed this tools are not present -if [ -x "$(iptable-save)" ]; then +# NOTE(sileht): If nova is not installed these tools are not present +if [[ $(type -P iptables-save) != "" ]]; then sudo iptables-save >$SAVE_DIR/iptables.$BASE_RELEASE fi -if [ -x "$(ebtables)" ]; then +if [[ $(type -P ebtables) != "" ]]; then sudo ebtables -t broute -L >$SAVE_DIR/ebtables-broute.$BASE_RELEASE sudo ebtables -t filter -L >$SAVE_DIR/ebtables-filter.$BASE_RELEASE sudo ebtables -t nat -L >$SAVE_DIR/ebtables-nat.$BASE_RELEASE