diff --git a/scripts/clifoldertemplate.sh b/scripts/clifoldertemplate.sh new file mode 100755 index 0000000..86463d9 --- /dev/null +++ b/scripts/clifoldertemplate.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +# Helper script for sending command scripts to Steward. +# Uses a template.yaml file and fils in the shell variables +# specified within the template. +# If no template file exist a default template.yaml file +# will be created. +# The template.yaml file can be modified to suit your own +# needs +# +# Example: +# ./clifoldertemplate.sh myship1,myship2 /bin/bash 'ls -l /etc' +# +# The scripts takes three arguments: +# First: A single node name, or a comma separated list of more node names. +# Seconds: The path to the interpreter as seen on the node the message is sent to. +# Third: The actual command execute specified within single quotes. + +# Create template is used when no template file is found, +# and will create a default template.yaml file. +function createTemplate() { + cat >"$PWD"/template.yaml <"$PWD"/msg-"$node".yaml + + cp msg-"$node".yaml ./readfolder +done