Hello everyone
I'm using execute command option in the Files and processes payload of a policy and want to run a small script ( 5 lines), I'm using a simple if statement to check whether a folder exists or not and create it, I'm getting a syntax error on the test client when I run it from Jamf however I tested and it works fine if I run it as a script from terminal so this issue is possibly the way I'm using semicolon, this could be done using script payload but I need to make it work this way.
This is working as a script
if [ ! -d "Path/to/location" ]
then
mkdir Path/to/location
Sleep 2
touch Path/to/location/hello.plist
else
touch Path/to/location/hello.plist
fi
This is how I added it to files and processes payload
if [ ! -d "Path/to/location/" ] ; then ; mkdir Path/to/location/ ; sleep 2 ; touch /Path/to/location/hello.plist ; else ; touch Path/to/location/hello.plist ;