Ok thanks I see a couple of possible problem points.
wait "{(client folder of current site as string) & "/__appendfile"}"
Here you should probably invoke /bin/sh directly. The ‘__appendfile’ you created doesn’t have the #!/bin/sh
at the start of it, nor the ‘.sh’ filename extension, so it won’t be recognized as a shell script. Try
wait /bin/sh -c "{(client folder of current site as string) & "/__appendfile"}"
There are also a few things around your ‘if’ statement…
if {exists file "/tmp/Query.txt" whose (line 2 of it (line 2 of it = regex("172329[[:space:]]+FE[[:space:]]+CHPTL[[:space:]]+0")))
…this line lacks the closing } symbol at the end of the line. It also comes inside your createfile
block, so the whole ‘if’ statement is literally inside the script you’re creating - not doing the flow control that you want. Move this whole line to before the ‘delete /tmp/Updater.sh’ statement and move the ‘endif’ for it to after executing the updater.sh
script (and, oh yeah, execute the updater.sh
with its own wait statement). The logic should be 'IF {an update is needed} (create & run & delete updater script) ENDIF