[#1766] move cpu count detection into separate bash script