Posted 30 July 2012 - 12:39 AM
init-scripts is a startup program that allows execution of several startup programs in different files, all without them interfering with each other.
Sounds cool! How do I write an init-script?
To write an init-script, just write a standard ComputerCraft Lua program, and stick it in /init-scripts/. Please follow the standard naming convention of "00_script", where "00" is the priority (lower numbered scripts get loaded earlier in the boot process), and "script" is the purpose/name of your script.
Once put in the /init-scripts/ directory, the script will automatically run on any computer with init-scripts installed.
Is there a way to disable an init-script without deleting it?
To disable an init-script, you don't need to completely delete it - just append a ".disabled" suffix to it. For example, "00_script" will be executed, while "00_script.disabled" will not. The disabling functionality can be enabled/disabled using the "Configuration Section" found in the main init-scripts startup file.
Is there any extra security options?
One security option (enabled by default) is verbose mode, which will tell you which each script is executing as the computer boots up. By default, you can also press ALT within 1 second of the computer starting up to enter "interactive mode", which will allow you to choose what will load and what will not load. Both of these options can be disabled in the "Configuration Section" in the init-scripts startup file.
What are some potential use cases?
You can grab init-scripts from pastebin here: http://pastebin.com/i6pmHKrK
Once downloaded, just put it in the root directory of your computer, named "startup".
How do I convert my existing startup script to work with init-scripts?
It's actually really simple! Just rename your startup script to something like 00_oldstartup (change the numbers if you want the script to execute after any other scripts you may have installed) and put it in the init-scripts directory. It should work fine without modification.
I've written a custom OS - how do I make it work with init-scripts?
Just make your installer detect the presence of the init-scripts directory. If the directory does not exist, install your OS's main script file as "/startup". If the directory does exist, you should install the main script file as "/init-scripts/99_OSnameHere". This will make it so that your OS will execute after all the other startup scripts that may be installed.
License
If you want to redistribute init-scripts (such as bundled with your software or a custom OS), please contact me first.
Sounds cool! How do I write an init-script?
To write an init-script, just write a standard ComputerCraft Lua program, and stick it in /init-scripts/. Please follow the standard naming convention of "00_script", where "00" is the priority (lower numbered scripts get loaded earlier in the boot process), and "script" is the purpose/name of your script.
Once put in the /init-scripts/ directory, the script will automatically run on any computer with init-scripts installed.
Is there a way to disable an init-script without deleting it?
To disable an init-script, you don't need to completely delete it - just append a ".disabled" suffix to it. For example, "00_script" will be executed, while "00_script.disabled" will not. The disabling functionality can be enabled/disabled using the "Configuration Section" found in the main init-scripts startup file.
Is there any extra security options?
One security option (enabled by default) is verbose mode, which will tell you which each script is executing as the computer boots up. By default, you can also press ALT within 1 second of the computer starting up to enter "interactive mode", which will allow you to choose what will load and what will not load. Both of these options can be disabled in the "Configuration Section" in the init-scripts startup file.
What are some potential use cases?
- Drivers
- Multiple startup scripts
- ..whatever you can think of!
You can grab init-scripts from pastebin here: http://pastebin.com/i6pmHKrK
Once downloaded, just put it in the root directory of your computer, named "startup".
How do I convert my existing startup script to work with init-scripts?
It's actually really simple! Just rename your startup script to something like 00_oldstartup (change the numbers if you want the script to execute after any other scripts you may have installed) and put it in the init-scripts directory. It should work fine without modification.
I've written a custom OS - how do I make it work with init-scripts?
Just make your installer detect the presence of the init-scripts directory. If the directory does not exist, install your OS's main script file as "/startup". If the directory does exist, you should install the main script file as "/init-scripts/99_OSnameHere". This will make it so that your OS will execute after all the other startup scripts that may be installed.
License
If you want to redistribute init-scripts (such as bundled with your software or a custom OS), please contact me first.