Environment variables
The CLI supports the following environment variables. Variable names are case-sensitive.
Table 65: Environment variables
$USERFROM | The management access type (ssh, telnet, jsconsole for the CLI Console widget in the web-based manager, and so on) and the IP address of the administrator that configured the item. |
$USERNAME | The account name of the administrator that configured the item. |
$SerialNum | The serial number of the FortiGate unit. |
For example, the FortiGate unit’s host name can be set to its serial number.
config system global
set hostname $SerialNum
end
As another example, you could log in as admin1, then configure a restricted secondary administrator account for yourself named admin2, whose first-name is admin1 to indicate that it is another of your accounts:
config system admin
edit admin2
set first-name $USERNAME
See Also