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
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.