ported bundle update script to bash