bmc: update bmc.sh to work on both linux and OSX