Software Overview  |  Sitemap  |  Downloads  |  Developers  |  Forums
Small_clear_logo_llc

Creating a Startup Script

In many situations, you want your Virtual Wiring System to power up with a particular configuration. Dedicated systems are a good example of this. If you create a system whose job is to make sure your home temperature is OK, check for water in the basement, and look for intruders, you don't want it to forget its job every time there's a power glitch. Sometimes you want your system to start performing a particular task every time it powers up.

Find or Create a Script to Run on Startup

In the Console Script Building section, we describe how to save a configuration into a Script. Clicking on the "Run" Action for that Script on the Scripts page recreates the system you saved. Now, we need a way to run that Script on power up.

In the "user" section of the Scripts, there is a Script called "startup.script". Whatever one puts into that Script will be run when the system starts up.

Add the Startup Script to the Startup File

  • Go to the Scripts page and run the Script you want the system to start up with. It should run without errors. Check the Console Log to be sure. If it doesn't run cleanly, make sure the system was cleared out by a restart just before running the Script.

  • Go to the Console display and look at the second to the last line. You should see the Script you just ran: run_script(.....).

  • Copy this line.

  • Open the "startup.script" file in the "user" area for editing (i.e., find the Script on the Scripts page and click on its Edit action).

  • Paste the run_script(...) command you just copied into the startup Script.

  • Scroll to the bottom of the editor and click on "Save".

  • Go back to the Scripts page and click on the "Restart" button.

Your system should restart and restore the configuration you just specified in the startup file.

Note: when Scripts are created or edited using the Scripts page, the Script cache for the system is automatically updated. There is no need to restart the system for it to see your changes.

You can add as many Script commands as you wish to the startup Script. As long as there are no errors, every line in the startup Script gets executed.

Catalina Computing, LLC.

Copyright © Catalina Computing, LLC. (2013-2018)




Page last updated: Wed Jul 15 21:55:03 2015 (UTC)