Load program configuration from the network

Loading endurance tests from the network offers several advantages for you as a user. On the one hand, it becomes easier to maintain a central inventory of long-term tests and changes to these can be used immediately without modifying any USB stick. In addition, the configuration file testlx.ini can be maintained centrally as well as files such as logos. You can also apply various Windows permissions to protect the folder from write access.

Preparation under Windows

First, please create a folder under Windows and share it as a network drive. You can find information about this in this KB-article. This shared folder will later contain all files (endurance tests, logos and settings) that should be centrally synchronized with all configured sticks every time they are started.

Preparation of USB sticks

So that the boot sticks from toolstar®testLX and toolstar®shredderLX Loading your configuration from the network must be a special file called prestart.sh can be stored on the USB stick in the testlx directory. This file is responsible for mounting the network drive and synchronizing the files. After synchronization, the program starts automatically and loads the previously copied files. You can download a minimal prestart.sh file here. In general, the prestart.sh file is always executed exactly before toolstar® starts. Any Linux commands can then be executed in this file to modify the environment in which toolstar® is located.

The commands for the prestart.sh file

First you need to create a virtual folder in the Linux RAM disk that serves as an anchor point for the network drive. To do this, enter the command mkdir /network in the prestart.sh file. You can choose the name freely. For example, exchange network with network or settings.

Next, the network drive needs to be “bound” to the previously created folder. To do this, use the command: mount //Server IP/Share /LocalFolder -o user=Username,pass=Password. Here the Server IP stands for the IP address of the Windows computer with the share and Share stands for the name of the folder under Windows. With user and pass you can also specify access data if this is required. This depends entirely on the settings of your share or Windows domain. Within a domain you can often use your personal information (i.e. the information you use to log in to Windows). If you use passwordless sharing, you can remove everything from -o. That would look like this: mount //Server IP/Share /LocalFolder.

Finally, we run the copy command to copy the data to the testlx directory on the USB stick. To do this, you can use the cp command. In our example the command would be: cp -a /network/* /testlx/. This command copies all folders, subfolders and files in the /network folder (i.e. our Windows share) to the testlx directory on the USB stick.

The complete prestart.sh file

Your prestart.sh file should then look like this and be in the testlx directory on the USB stick (with different access data and if the template from toolhouse was used as a basis):

# This shell script is executed once before the automatic start of
# toolstar*testLX.
# So if you need some custom initializing, you can put it here...
#

# 1. Create a folder to mount the network folder to
mkdir /network
# 2. Mount the Windows PC with IP 192.168.253.19 and Share WindowsFreigabe to the
# folder from step 1.
mount //192.168.253.19/WindowsFreigabe /network -o user=toolhouse,pass=toolhouse
# Copy all files from the network share into the local folder on the usb drive
cp -a /network/* /testlx/

Linux and Windows: line terminators

Linux (Unix) and Windows use different control characters to mark the end of a line in text. In the case of Windows/DOX a \r\n is used. Under Linux/Unix only one \n is used. When editing and saving the prestart.sh file under Windows, please make sure that you do not change the line terminators. A program that supports the transfer seamlessly is notepad++. In many cases this also works with other editors. When saving, just pay attention to the question of whether the editor should switch to Windows CRLF or keep the current setting. If line termination is changed to \r\n, Linux may no longer recognize the file correctly.

The example file provided by toolhouse is already set correctly.

Editor: Notepad++

In Notepad++ you can use the menu View->Non-printable characters->Show all characters to display control characters in addition to the classically visible characters. In addition, you can switch from Windows (CR+LF) to Unix (LF) at the bottom right if this is not already the case.

Bug fix: Slow connection establishment

Under certain circumstances, establishing a connection to the specified network drive may take longer. On the one hand, this can be due to the configuration of the Windows system or due to a delayed initialization of the network under Linux. The error is shown by the fact that when starting toolstar®testLX or toolstar®shredderLX the endurance tests do not yet appear in the menu. If you then exit the program and go to the /network directory, the files can be seen. To delay the establishment of the connection, the sleep command in the Linux bash environment can be used. This gives the operating system a few seconds more time to initialize the network environment of the local device. The prestart.sh then looks like this:

# This shell script is executed once before the automatic start of
# toolstar*testLX.
# So if you need some custom initializing, you can put it here...
#

# 1. Create a folder to mount the network folder to
mkdir /network
# 2. Sleep 5 seconds right before mounting the network drive
sleep 5
# 3. Mount the Windows PC with IP 192.168.253.19 and Share WindowsFreigabe to the
# folder from step 1.
mount //192.168.253.19/WindowsFreigabe /network -o user=toolhouse,pass=toolhouse
# Copy all files from the network share into the local folder on the usb drive
cp -a /network/* /testlx/
Cookie-Einwilligung mit Real Cookie Banner