Automation for Linux

A major consideration when using a Linux distribution is the lack of a GUI for many of the system administration tasks.  Programmers are pretty much relegated to the command line without some fairly sophisticated tools.

A c++ program issues sudo command to execute shell commands while routing the output to a text file and subsequently reading that text file into a GUI where the user is able to perform required tasks on the operating environment.

In the following example the fdisk output was rerouted and used in the application.

The following popup allows for selection of source and destination targets.

When a directory is selected and this popup is envoked the directory name is extracted, the mount command is issued and the the output is directed to the “Source Files” tab.

Return to the Partitions tab and traverse to the target destination directory.

When a directory is selected and this popup is envoked the directory name is extracted, the mount command is issued and the the output is directed to the “Destination Files” tab.

The popup on the “Destination Files” tab appears below.

When the “Rename” option is envoked the following dialog will appear.

Notice a name of the “New Copy” is populated with a suggested name but the “/usb/” should be preserved to ensure the renamed file’s proper location.

When the “Delete” option is selected the following confirmation dialog will appear.

When the user clicks on the “Yes” control the file will be deleted otherwise no action is taken.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

Leave a Reply

Your email address will not be published. Required fields are marked *