Creating a fixlet to run yum update -y

I’ve attempted to create a fixlet to run the following commands
#!/bin/sh
yum -y update --nogpgcheck
yum clean all
rm -rf /var/cache/yum

I came up with this

//Shell to Action Script Conversion Utility
delete __appendfile

appendfile #!/bin/sh
appendfile yum -y update –nogpgcheck
appendfile yum clean all
appendfile rm -rf /var/cache/yum

//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”}”

Could someone help me fix it

Try changing the last line to invoke the shell directly (assuming the script itself does what you want) and also explicitly use ‘pathname of folder’

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

2 Likes

Thank you for the response. I received these commands from the conversion site. what I’m trying to accomplish is simply this. Create a fixlet that will go to a targeted Linux server, run the yum -y update -nogpcheck command and when done reboot the server.

You can execute the command as mentioned by @JasonWalker and in the Post Action use restart system after action completes.

I recommend you do this as a TASK rather than a FIXLET.

The TASK only cares that all the lines ran without error. A Fixlet will re-evaluate the Relevance clauses and they would have to evaluate to FALSE after the completion or you get a FAILED status.

3 Likes