I’m trying to figure out how to run more than one script as part of an action/task. Action1 does the work of actually deploying the package shown below – all of our clients are Macs. I want to run a bash script after doing this, but if I click Add next to the script list and paste in a script for this, it only ever runs Action1 and there is no option to select more than one.
You can only run 1 action at a time from a Fixlet – and you’d only really ever want to run 1 action at a time. When you action the fixlet each action appears in the dropdown.
Technically you could make another action, make a baseline, and add both the actions from the fixlet. The issue with this is that you cant have separate relevance statements for each action so you’ll get weird behavior doing this.
Your best bet is to just add the script to the end of Action1. Write out the bash script using actionscript (or download the bash script) and then just run it within the same task.
My recommendation would be to add the script after the fact if it’s not part of your package. Edit the task like your screenshot suggests then add it into the Action1 ActionScript using the “createfile until” function.
createfile until THISISTHEEND
#!/bin/sh
echo Hello World!
THISISTHEEND
At this point, you have your script, line for line, created on the endpoint. Then you give it permission to execute and run it.
wait chmod +x {(client folder of current site as string) & "/__createfile"}
wait {(client folder of current site as string) & "/__createfile"}
You really just want to run multiple commands in the same action in a sense.
You can have multiple wait statements to do this.
You can use a create file actionscript to actually create the batch file dynamically in line with the actionscript so that you don’t have to upload and download the batch file. Using create file is faster and lets you iterate more easily.
Since this is just a simple single command that you are trying to run, then there is no reason to use a batch file at all. You can just run the command similarly to how @jmaple puts it.