Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Not applicable

Inserting a PURGE command into a script

I have, what I hope to be, a simple question. I am writing a script to update our branch firewall Whitelist and would like to include a purge command. My thoughts are to have the script purge the current list and write the new one. My problem is the purge command requires a “y” to acknowledge the request and I can’t figure out how to write this into the script. Basically #config webfilter url #edit 2 #config entries #purge <---------give the y for yes(this is where i get stopped Then write the new list If I putty into the firewall, I can copy and paste my script. I merely added a line after the purge line with a " y" , and it works fine, but if i attempt to load the script as a text file I get an error. I have attempted to paste from the CLI in the web interface and can see the error occurs with the confirmation at the PURGE command
3 REPLIES 3
rwpatterson
Valued Contributor III

Welcome to the forums. try:
#purge\ny
\n = new line Good luck

Bob - self proclaimed posting junkie!
See my Fortigate related scripts at: http://fortigate.camerabob.com

Bob - self proclaimed posting junkie!See my Fortigate related scripts at: http://fortigate.camerabob.com
Not applicable

That worked perfect. Thank you very much
Not applicable

I am interested in doing a similar thing but am having no success. I' d like to automate a series of commands including the following. I had planned on simply pasting the series of commands to the command line in the CLI console widget. config wireless-controller wtp-profile edit " 220B" config deny-mac-list purge y end end The line with the lone y is trying to answer the " Do you want to continue" prompt after the purge command. It doesn' t work. purge\ny did not work for me either. I am cutting and pasting from Windows Notepad. Any other ideas on how to approach this? Thanks much!
Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors