02-05-2015 06:55 AM
I'm wanting to create a script that will reboot a Juniper SRX650. I'm running into a problem after issuing the "request system reboot" command. The command sequence on the Juniper appliance looks like this:
user@juniper> request system reboot
Reboot the system? [yes,no] (no)
Because no "user@juniper>" is returned, the script does not reply with the necessary "yes" statement to confirm the reboot. In this case, a /r for a carriage return would select "no" and stop the reboot process. Is there a way to make the script recognize the "Reboot the system? [yes,no]" prompt and reply with "yes"? Or a way to create a delay between the "request system reboot" command and a "yes" command that would force the script to reply with "yes" no matter what?
Thanks in advance for any help!
02-05-2015 07:34 AM
I would recommened using the "at" instead
user@host> request system reboot <at time> <in minutes> <media type> <message “text”>
request system reboot at 1 \r yes \r ( it reboots in one minute and does not error out)
If questions are asked, intersperse the answer:Copy Run StartAre you Surey/n)Would beCopy run start \ry\r