fix bash regexp in upgrade scripts
Merge pull request #4863 from VojtechVitek/stage_fix_bash_regexp

[TO_STAGE] fix bash regexp in upgrade scripts