Difference between revisions of "Startup"
m (Category change) |
(Noted boot order. Removed forward slashes from example code paths (lua paths do not begin with a slash)) |
||
Line 1: | Line 1: | ||
==Startup Scripts== | ==Startup Scripts== | ||
− | If, upon booting, a computer terminal detects a script named "startup" in its root directory, this script will be run. Similarly, if a disk is present in an attached disk drive containing a script named "startup" that script will be run. | + | If, upon booting, a computer terminal detects a script named "startup" in its root directory, this script will be run. Similarly, if a disk is present in an attached disk drive containing a script named "startup" that script will be run. Disk autorun scripts take prevalence over root directory autorun. This means if both the root directory and the disk contain a file called "startup" the one on the disk will be executed. |
===Very simple auto-install script to set up a single-use terminal (e.g. password-protected door):=== | ===Very simple auto-install script to set up a single-use terminal (e.g. password-protected door):=== | ||
Line 8: | Line 8: | ||
The script could look like: | The script could look like: | ||
− | fs.copy(" | + | fs.copy("disk/startup.file", "startup") |
shell.run("startup") | shell.run("startup") | ||
Revision as of 18:43, 20 March 2012
Startup Scripts
If, upon booting, a computer terminal detects a script named "startup" in its root directory, this script will be run. Similarly, if a disk is present in an attached disk drive containing a script named "startup" that script will be run. Disk autorun scripts take prevalence over root directory autorun. This means if both the root directory and the disk contain a file called "startup" the one on the disk will be executed.
Very simple auto-install script to set up a single-use terminal (e.g. password-protected door):
Disk contents:
/disk/startup (installer script) /disk/startup.file (program to be installed on terminal)
The script could look like:
fs.copy("disk/startup.file", "startup") shell.run("startup")
When the disk is placed into a drive attached to a terminal, and the terminal is rebooted - the startup file on the disk will run. This startup file serves only to copy the program you've named "startup.file" to the root directory of the terminal with the new name "startup" - this will then run each time the terminal is booted, eliminating the need for the disk drive.