The Shell Script connector enables you to execute a list of shell commands on a remote server such as AWS, Azure, Droplet, and more by establishing an SSH connection.
SSH Key Requirement: The Shell Script connector operates using an SSH Key. Therefore, it is essential to have an SSH key associated with your DronaHQ account. If you are unfamiliar with SSH keys and their management, you can learn more about them here.
Server Configuration: The server you intend to connect to must have the public key generated by DronaHQ (known as the SSH Key) saved within its configuration. This step is crucial for enabling successful connections from the DronaHQ environment to the server.
SSH Public Key Storage: To facilitate the connection, the SSH public key generated by DronaHQ must be stored on the remote cloud server. Typically, this involves placing the SSH public key in the authorized SSH key file located at
/home/username/.ssh/authorized-keyson the remote server.
Configuring Connector in DronaHQ
Configure your database category using the provided details.Validate connection with
Test connection and
Save settings for secure database setup.
|Host||Enter the Host Domain or IP|
|Port||Enter the Port number|
|Database Name||Enter the Database name|
|Username||Enter the Username|
|Connection Options||The |
|SSH Keys||Ensure you have SSH keys available in your DronaHQ account for secure connections. The server you want to connect to must have the DronaHQ-generated public key/SSH Key saved in it.|
|Whitelist IP||Enhance security by restricting database access to specific whitelisted IP addresses.|
Adding Queries to the Connector
Once you have successfully configured the connector, you will find it listed among your Custom Database connectors.
While the server can execute various actions through shell scripts on the backend, utilizing the terminal for these actions can be intricate. To simplify this process and provide a more user-friendly experience, you have the option to leverage a platform that enables smoother action execution.
By clicking the
Add query option, which becomes available after your connection is established, you can conveniently define specific actions to perform on the server.
Supported Query Operations
|Shell Command||Execute custom shell commands directly, facilitating a wide range of server-side operations.|
|Script Execution||Run pre-defined shell scripts or shell script files to accomplish specific tasks or workflows.|
Using Shell Script Connector
Data Bind using Data Query
Read/Display Data Query for Shell Script Connector:
Begin by crafting a shell script command to extract data using the Shell Script Connector. For example, consider a scenario where you want to retrieve data based on the username "a". The shell script command is:
Shell script command used:
grep "a" /path/to/datafile.txt
This shell script command uses the
grep utility to search for lines containing the username "a" in the specified data file.
Integrate the fetched data into your application's interface.
a. Access the Controls section and introduce the appropriate control for displaying the data.
b. Navigate to
Data Bind Options -> Quick Select -> Database Queries.
c. Opt for the Shell Script connector and choose the command that aligns with your data retrieval goals.
By following these steps, you can seamlessly execute the shell script command and retrieve data based on the username "a" using the Shell Script Connector, enhancing your application's functionality and user experience.