Hi Team,
Hope we all are doing good!!
I am creating a fixlet to un-install a software using a bat script and have made the below shown fixlet, could you please suggest if this to be ‘ok’ if not then please suggest remediation on the below action script. Ty
// Using the batch script in BigFix action script to perofrm the un-installation of Atom software.
createfile until END_OF_FILE
DIR="/usr/EY_AtomBot-2.1/"
if [ -d "$DIR" ]; then
# Remove old bot. #
echo "Removing old bot from ${DIR}..."
/etc/init.d/ATOMBOT stop
chkconfig ATOMBOT disable
rm -f /etc/init.d/ATOMBOT
rm -rf /usr/EY_AtomBot-2.1
fi
END_OF_FILE
delete c:\temp\atom-uninstall.bat
move __createfile c:\temp\atom-uninstall.bat
wait atom-uninstal.bat
It looks like this is ActionScript generated by a converter utility, but I’m not familiar with it - is this a custom utility or something we provided?
In any case it looks mostly correct, except the first line of the shell script should reference the shell to use as interpreter - the first line should usually be
#!/bin/sh
And while the ‘wait’ command may work as written, on some platforms we may need to call the shell explicitly
wait /bin/sh "{(client folder of current site as string) & "/__appendfile"}"
Thanks, Jason, for responding to it, I have the converter utility that I use to convert the shell scripts to BigFix action script :- https://bigfix.me/content/shelltoaction
is this ‘ok’ to use?
I will get the first line changed and updated.
I usually find it better to MOVE the script file to a tmp folder and run it from there. Most of our boxes won’t let me run scripts from inside the BES Client folders reliably.