Script giving error in execution

I have a script which I got converted via link https://www.bigfix.me/content/shelltoaction and it basically tp check the servers which have uptime greater then 90 days:-1:
Script:-1:
#!/bin/sh
awk ‘{if($1>90243600)
print "Uptime is greater then 90 days"
else
print “Uptime is less then 90 days”
}’ /proc/uptime > /tmp/numberofdays

Action script:-1:

//Shell to Action Script Conversion Utility
delete __appendfile

appendfile #!/bin/sh
appendfile awk ‘{{if($1>90243600)
appendfile print "Uptime is greater then 90 days"
appendfile else
appendfile print “Uptime is less then 90 days” }’ /proc/uptime > /tmp/numberofdays

//modify appendfile to allow execution
wait chmod 555 "{{(client folder of current site as string) & “/__appendfile”}

//execute shell script as written
wait “{{(client folder of current site as string) & “/__appendfile”}”

It is creating the required file at server but the action is failing with the below error :-1:

Completed //Shell to Action Script Conversion Utility
Completed delete __appendfile
Completed appendfile #!/bin/sh
Completed appendfile awk ‘{{if($1>90243600)
Completed appendfile print "Uptime is greater then 90 days"
Completed appendfile else
Completed appendfile print “Uptime is less then 90 days” }’ /proc/uptime > /tmp/numberofdays
Completed //modify appendfile to allow execution
Failed wait chmod 555 "{{(client folder of current site as string) & “/__appendfile”}
//execute shell script as written
wait “{{(client folder of current site as string) & “/__appendfile”}”

Please suggest remediation. Thank you.

You are using two open curly brackets when in these cases, you do want the relevance substitution. Change that to one open curly bracket.

Also, you may need to call the shell explicitly as in

wait /bin/sh -c "{(client folder of current site as string) & “/__appendfile”}”

Thanks Jason, It executed placed the file required at server but action failed shows error code 126, refer to logs below:-1:
Command started - wait /bin/sh -c chmod 555 “/var/opt/BESClient/__BESData/actionsite/__appendfile” (action:573381)
At 07:40:32 -0500 -
Report posted successfully
At 07:40:32 -0500 - actionsite (http://PEPWAP07468.corp.pep.pvt:52311/cgi-bin/bfgather.exe/actionsite)
Command succeeded (Exit Code=1) wait /bin/sh -c chmod 555 “/var/opt/BESClient/__BESData/actionsite/__appendfile” (action:573381)
Command started - wait /bin/sh -c “/var/opt/BESClient/__BESData/actionsite/__appendfile” (action:573381)
Command succeeded (Exit Code=126) wait /bin/sh -c “/var/opt/BESClient/__BESData/actionsite/__appendfile” (action:573381)

Server end shows the correct output:-1:
t01lap00065:~ # cat /tmp/numberofdays
Uptime is greater then 90 days

Action script changes:-1:
//modify appendfile to allow execution
wait /bin/sh -c chmod 555 “{(client folder of current site as string) & “/__appendfile”}”

//execute shell script as written
wait /bin/sh -c “{(client folder of current site as string) & “/__appendfile”}”

Check whether the appendfile was actually created.

Also on the first command the ‘chmod’ statement should be inside the doublequotes.