Using OS Reload Shell Scripts

Using OS Reload Shell Scripts #

Adding & Editing Shell Scripts #

You can add Shell Scripts from the OS Reloads > Shell Scripts page. Shell Scripts use the Smarty v3 templating engine. You can see examples of this in use in the shell script debian-networking.tpl.

Smarty templates and curly braces #

Smarty uses curly braces - { and } - as part of its own syntax. As a result, BASH commands that use curly braces will need to be escaped. The easiest way to do this is to wrap any code using curly braces like so:

{literal} <some bash code with { and }> {/literal}

{literal} will stop Smarty from rendering the code inside as Smarty code and will instead just output whatever is within the braces.

We do not recommend editing shell scripts created by SynergyCP except for testing purposes. The shell scripts that are added by the system are subject to changes with future improvements of the software. Instead, simply create a new shell script and add it to the existing profile for the relevant OS Reloads.

Using Shell Scripts in an OS Reload #

To use a Shell Script in an OS Reload, you will need to create an OS Reload Profile for the Shell Script. You will want to base your OS Reload Profile settings on the OS Reload Profile for that OS, and then add your Shell Script to the new profile.