You can try the attached script. It is written to pause for three minutes upon execution and five seconds between the offline and online commands.
To use it, first copy it into the /var/db/scripts/event directory and then enter the following configuration:
event-options {
policy chassisd {
events SYSTEM;
attributes-match {
SYSTEM.message matches .*chassis-control.*;
}
then {
event-script bounce-pic.slax;
}
}
event-script {
file bounce-pic.slax;
}
}
I'm assuming that you're using JUNOS 9.0 or beyond, if not then let me know as the storage location and configuration is slightly different.