Working with Scripts : Script samples : CLI scripts
 
CLI scripts
CLI scripts include only FortiOS CLI commands as they are entered at the command line prompt on a FortiGate device. CLI scripts do not include TCL commands, and the first line of the script is not “#!” as it is for TCL scripts.
CLI scripts are useful for specific tasks such as configuring a routing table, adding new firewall policies, or getting system information. These example tasks easily apply to any or all FortiGate devices connected to the FortiManager system.
However, the more complex a CLI script becomes the less it can be used with all FortiGate devices - it quickly becomes tied to one particular device or configuration. One example of this is any script that includes the specific IP address of a FortiGate device’s interfaces can not be executed on a different FortiGate device.
Samples of CLI scripts have been included to help get you started writing your own scripts for your network administration tasks.
Error messages will help you determine the causes of any CLI scripting problems, and fix them. For more information, see “Error Messages”.
The troubleshooting tips section provides some suggestions on how to quickly locate and fix problems in your CLI scripts. For more information, see “Troubleshooting Tips”.