How to find out if the fabric is ready to IB communication after a switch reboot

I’m currently developing a script to automate a IB switch reboot (reload). Though I was able to trigger a switch reboot easily I don’t know a way to find out if the switch is ready for normal operation.

I have been using the time which I can issue an enable through CLI. will that be enough to identify the switch is ready for normal operations?

When the switch responds to “ibswitches” after a reboot, run from any IB server, it is UP and detected by the Subnet Manager and ready to start passing traffic.