Skip to content

Creating and Configuring Scripts

Adam Furbee edited this page Nov 7, 2017 · 5 revisions

Basic Script Uploading

Place a script in the scripts directory and run ./sync.py --url https://your.jss.com:8443 --username git2jss_admin --password your_password_here. This will upload each script in the scripts directory to the JSS with the default name being the file name.

The only information that is updated when doing this is the script content, if the script already exists in the JSS and has other information populated such as parameters, info, etc... This information will be retained in the JSS unless a template has been created.

Supported Extensions

The following file extensions will be treated as scripts, any other file types in the script directory will be ignored.

.sh, .py, .pl, .swift

Script Uploading with Templates

Templates are a special way of populating additional data in the JSS, this allows us to specify things like parameters or information in our git repo and have it uploaded to JSS.

An example can be found in scripts/templates/sample_script.xml, each template must have the same basename of the script - for example we cannot have sample_script.py and sample_script.sh as scripts because sync.py will not be able to determine which one it should use. (this may be resolved in a future update by specifying the full script name and appending .xml ex - sample_script.py.xml)

Template Example

<script>
  <name>Apply Software Updates</name>
  <category>Scripts</category>
  <filename></filename>
  <info/>
  <notes>Created By: Adam Furbee</notes>
  <priority>After</priority>
  <parameters/>
  <os_requirements/>
</script>

Clone this wiki locally