fix bash regexp in upgrade scripts