To run the Gateway Command-line Utility, open a command shell and type: gwcmd <option>. This example uses the Windows platform:
- Open the Command Prompt with admin privileges. In the search bar, enter cmd then right click next to the Command Prompt to select Run as administrator.
- Any time you run any of the Gateway command utility options, you need to run them from the directory that Ignition is installed in. The default install directory is: C:/Program Files/Inductive Automation/Ignition.
From here, you can enter any of the command options listed in the table below. This example is of a Gateway backup using the following command: gwcmd -b "C:/Gateway Backups/Backup_190108.gwbk".
Using spaces in a file path
When using spaces in a file path name, use quotation marks around the full path name, as shown in the example above. Forward or backward slashes can be used to separate folders. The file path includes the disk name, folder path, and file name.
The above command created a Gateway Backup on the C drive, in the Gateway Backups folder with a file name of Backup_190108.gwbk. The image below shows all the commands used in Steps 2 and 3.
Use the Command-line Utility to Start or Stop the Gateway
One of the common uses for the Command-Line Utility is to start or stop the Gateway.
Ignition's installation directory contains
stop-ignition.bat, which can start or stop the service. Example:
However, you can also use Windows native service commands to control the running state of the Gateway:
You can control the service using the
ignition.sh script. It can be called with the
stop parameters to perform the relevant operations.
Additionally, you can use native terminal commands to start or stop the service:
Mac OS X
You can access the service from the install directory using the "ignition.sh" script. On a typical Mac install using the dmg installer, the full command (without a custom location specified) is the following:
Command-line Utility 'gwcmd' Options
The following table lists all available 'gwcmd' options.
|Creates an |
Downloads a Gateway backup
You will be prompted whether it is OK to overwrite the file if another
Clears the gateway's SSL / TLS setup. The gateway's SSL / TLS connector will be immediately shut down.
|Use with the |
Exports the gateway's SSL key store in PKCS12 format and saves to the specified path.
Exports the private key from the gateway's SSL key store in PEM format and saves to the specified path.
Reloads the Gateway's SSL keystore from disk. Any update to the keystore will be automatically applied to any new connections.
|Shows the usage for this command.|
|Retrieves server status and port information from the Gateway if it is running.|
|Changes the Gateway http port.|
|Changes the Gateway https port.|
Add to the export private key command to not encrypt the private key.
Specifies a Gateway name while restoring a backup. Additionally, the
|Enables a password change for the initial user.|
|Restarts the Gateway.|
Restores a Gateway backup (.gwbk) file.
|Performs a thread dump in the Gateway and prints the dump to the command-line.|
|Creates an |
|Applies a |
|Automatically answers |
Reset the Password
If something happened and you can't get into the Gateway Webpage anymore, you may need to reset the master username/password. You can use this Gateway Command-line Utility to reset the main password for the user with full privileges. This 'gwcmd' utility triggers system commissioning, and prompts the user to enter a username and password for the main user (with full privileges) after the Gateway restarts.