Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78a6854e authored by Sam Bobroff's avatar Sam Bobroff Committed by Michal Marek
Browse files

merge_config.sh: exit on missing input files



Add a check for the existence of input files and exit (with failure)
if they are missing.

Without this additional check, missing files produce error messages
but still result in an output file being generated and a successful
exit code.

Signed-off-by: default avatarSam Bobroff <sam.bobroff@au1.ibm.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.com>
parent 09cd7555
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -100,6 +100,10 @@ cat $INITFILE > $TMP_FILE
# Merge files, printing warnings on overridden values
for MERGE_FILE in $MERGE_LIST ; do
	echo "Merging $MERGE_FILE"
	if [ ! -r "$MERGE_FILE" ]; then
		echo "The merge file '$MERGE_FILE' does not exist.  Exit." >&2
		exit 1
	fi
	CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE)

	for CFG in $CFG_LIST ; do