Maybe use perl and do something like
Code:
#!/usr/bin/perl
open(PING, "ping -i 300 |");
while(<PING>) {
if(m/"No route to host"/) {
system("your_channel_closing script");
system("your_channel_openning_script");
}
}
If closing and rebonding the chanel takes more than five minutes you're going to get a false positive from the next ping response though, so be careful.