Browse Source

Added a protection against empty config file

Dmitry Yu Okunev 7 years ago
parent
commit
d7fb5ce6ad
1 changed files with 7 additions and 0 deletions
  1. 7 0
      ipw

+ 7 - 0
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