Nice work, I made some similar scripts myself but never incorporated pool detection/switching.
Start the miners each in their own GNU Screen sessions and set this to run at start up in your DE of choice (and set automatic log in of course) and bam, this script is now ideal for headless mining. The screen sessions will allow users to view the miners though SSH. I like to start an extra session as well just so i can run aticonfig if i need to check my temps/adjust fan speed/what have you.
I've been working on a way to detect locked up miners, I'll let you know if I find anything interesting.
I'm just detecting GPU load via aticonfig --adapter=X --odgc and killing GPUs which aren't under load.
Also, yeah this works for headless I guess, screens are named $identifier-MINER so if you set an identifier to 'Radeon5850' the screen would be called 'Radeon5850-MINER'. Temp screen is called 'temps'.