Update updater.sh

reversed conditional check so it warns profile doesn't exist on non-zero exit code from grep
This commit is contained in:
Tyler Page 2019-07-06 06:48:38 +00:00 committed by GitHub
parent 52bb5f7658
commit b8466f24ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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