From b8466f24ae7580af78cf00785dc77712ea0b7d4c Mon Sep 17 00:00:00 2001 From: Tyler Page Date: Sat, 6 Jul 2019 06:48:38 +0000 Subject: [PATCH] Update updater.sh reversed conditional check so it warns profile doesn't exist on non-zero exit code from grep --- updater.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updater.sh b/updater.sh index 2c9003f..52d2a88 100755 --- a/updater.sh +++ b/updater.sh @@ -156,7 +156,7 @@ readIniFile () { # expects one argument: absolute path of profiles.ini read -p 'Select the profile number ( 0 for Profile0, 1 for Profile1, etc ) : ' -r echo -e "\n" if [[ $REPLY =~ ^(0|[1-9][0-9]*)$ ]]; then - if grep "^\[Profile'${REPLY}" -A 4 "$inifile" | grep -v "^\[Profile'${REPLY}" > "$tfile"; then + if ! grep "^\[Profile'${REPLY}" -A 4 "$inifile" | grep -v "^\[Profile'${REPLY}" > "$tfile"; then echo "Profile${REPLY} does not exist!" && exit 1 fi else