Main page Up Main page Chapter 2: Using the CLI Utility  

1 CLI Quick Overview

The InterWorx Control Panel offers a command-line utility allowing server administrators to perform InterWorx functions without having to log in to the web interface. This utility can also be used in shell scripts to perform automated batch operations.
The CLI utility is part of the default InterWorx repository that is installed to your system when you first install InterWorx. You can use yum to install the utility by running the following command as root:
[root@server ~]# yum install interworx-cli

1.1 Overview of the CLI Utility

The CLI utility is comprised of two commands: ’nodeworx’ and ’siteworx’. The ’nodeworx’ command is used to perform administrator and reseller functions that you would normally access in the NodeWorx control panel; the ’siteworx’ command is used to perform SiteWorx user functions on specific SiteWorx accounts that are normally accessed on the SiteWorx control panel.
For example, adding a new reseller would be done by using the ’nodeworx’ command and adding a new e-mail alias for a SiteWorx user would be done by using the ’siteworx’ command.
Both commands allow you to use the -h option to get a usage summary.

1.1.1 CLI Authentication

In order to use these commands, you must supply authentication. The basic way to authenticate is to simply use either the nodeworx or siteworx command and you will be prompted for credentials.
[root@server ~]# nodeworx 
| NodeWorx Login                                                     | 
E-mail : 
Password [] : 
[root@server ~]# siteworx 
| SiteWorx Login                                                     | 
E-mail : 
Password [] : XXXXXXXXX
Domain : 
Notice that the SiteWorx login also requires that you enter the domain of the SiteWorx account in question, just like logging in via the web interface.

1.1.2 Unix User-Based Authentication

Since it would be silly to require someone who already had root access to the server to have to re-login again, it is possible to authenticate based on the Unix user. The root user may log into the master NodeWorx user by using:
[root@server ~]# nodeworx -u
This is also helpful when writing scripts because you will be able to skip the authentication prompt. With InterWorx version 4.6.0 and later, the root user may also login to any SiteWorx account with:
[root@server ~]# siteworx -u 
SiteWorx users with shell access can also use the siteworx CLI utility and authenticate by logging in to a shell and entering the following command:
[siteworx@server ~]$ siteworx -u
That’s it!
 Main page Up Main page Chapter 2: Using the CLI Utility  

(C) 2019 by InterWorx LLC