Skip to main content
bbumanla
New Member
March 7, 2022
Question

How to respond "y" in a script for the factoryreset command?

  • March 7, 2022
  • 4 replies
  • 3596 views

Hi,

I'm trying to run a script:

execute factoryreset
y

 

to do a factory reset from a Fortimanager script, but not sure how to pipe "y" to the question when it get prompt:

execute factoryreset
echo y


FWF60E # execute factoryreset
This operation will reset the system to factory default!
Do you want to continue? (y/n) <<<<<< what to add in script to execute


FWF60E # execute echo y

command parse error before 'echo'
Command fail. Return code -61

FWF60E #

 

Any info would be helpful oi

 

4 replies

amouawad
Staff
Staff
March 7, 2022

Just enter y in a new line.

 

So the script would be:

 

execute factoryreset
y

 

I just tested and confirmed it works on FMG 6.4.7.

 

2022-03-08_10-35.png

 

bbumanla
bbumanlaAuthor
New Member
March 8, 2022

This is the original script which is exactly like yours, but I have a lab setup behind a local spectrum router.  At the spectrum router, I have portforwarding setup for https port 443 and http port 80, should I open another port?  From the fortiwifi, Security Fabric>Settings>Use Fortimanager was on and after I ran it the 1 time, from Fortimanger said wan1 was down, but I can get to Fortiwifi it could no longer to the Test Connectivity test.  What other ports should I put my spectrum router/modem to keep the communication up when executing the factoryreset from Fortimanager?

 

bbumanla
bbumanlaAuthor
New Member
March 8, 2022

If it makes any difference, my 60E is setup to use dhcp.

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.