How many radios have I got?

I have a problem in my RB.
Sometimes I loose connection with remote RB, so I enter in my RB and I see I have only one radio (there are 3 total radios).
I reboot and all it’s ok.

I would like to avoid to enter and reboot manually, also make a scheduled reboot.

I would like mahe a script that controls how many radios are listed, if different from 3, then I reboot.
How can I enumerate the number of radios?
Thanks.

The reboot script would be a temporary fix. I would try to find why the radios disappear. If it gets worse, you could find the RB rebooting all the time.

More info on the equipment and setup might help someone here spot what is wrong.

ADD: I would try a script that notifies you by email if the radios fail, if it can still send email after a radio failure. That might be more useful.