From d7fb5ce6ada53b072c71672776468f29e2c24ac8 Mon Sep 17 00:00:00 2001 From: Dmitry Yu Okunev Date: Wed, 5 Nov 2014 18:57:04 +0300 Subject: [PATCH] Added a protection against empty config file --- ipw | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/ipw b/ipw index 1add0f8..03f65fe 100755 --- a/ipw +++ b/ipw @@ -311,6 +311,13 @@ case "$CMD" in fix) #fix all interfaces to config state #brctl addif bond0 eth2 + if [[ "$IPW_CONFIG_PATH" != "/dev/null" ]]; then + if [[ "$(cat $IPW_CONFIG_PATH 2>/dev/null)" = "" ]]; then + eerror "Empty config file" + exit -1 + fi + fi + #GETTING INFORMATION ABOUT LXC INTERFACES IN BRIDGES if [[ "$LXC_DIR" != "" ]]; then -- libgit2 0.24.0