I am relatively new to Bamboo engine. I am writing a script to blow away a cache on each build agent. However, before blowing away cache, I need to check if any build agent is performing any build. If yes, then my script will wait till it finished its job else it will straight away remove cache. Not sure how to check build-agents status from scripts.