Example scripts
Example scripts that you can use in your lifecycle scripts.
These example scripts may use software that is not be available on every operating system.
Track setup scripts
Wait for bootstrap
Wait for the Instruqt bootstrap process to complete.
The bootstrap process may overwrite user files like .bashrc
. Wait is encouraged!
Wait for service
Wait for a specific web service in your setup script to finish booting.
Create a file
Create a file using heredoc method.
You can append to a file by using >>
as opposed to >
.
Download files
Download files to the local system.
Start background process
Start a process in the background so your script does not hang.
Challenge check scripts
File exists
Check if a file exists:
File doesn't exist
Check if a file doesn't exist (or is not a file):
Directory exists
Check if a directory exists:
Directory doesn't exist
Use the following code in your life cycle script to check if a folder doesn't exist (or is not a directory)
File contains certain text
Check if a file contains certain text.
Specific command is installed
Check that a specific command is executable with the -x flag.
Service is running
Check if a service is running.
Replace SERVICE with a service name running on that system.
Last updated