I'm using a script with the lf_script_action trigger. In the script I'm attempting to call clamscan. I have written the script correctly as far as its functionality, and I can run it from the command prompt manually passing fake input to it and it works, but when csf runs my script the clamscan fails. I'm unable to figure out why though, and hoping for some insight from the csf side why it might not work. The entire script works except for the call to clamscan which is tucked in to a variable such as;
var=`clamscan "$1"`
Thanks for any insights on this.
lf_script_action command nesting?
-
- Moderator
- Posts: 1524
- Joined: 01 Oct 2008, 09:24
Re: lf_script_action command nesting?
You should use the full path to binaries within scripts to ensure that PATH issues do not occur. It would also be better, if you have clamd running as root, to use clamdscan rather than clamscan.
Re: lf_script_action command nesting?
Thank you for your reply. I tried using the full path as you've suggested but unfortunately although it still works when called directly from the prompt, when csf calls it, it appears to be parsing the command instead of taking the output of the script and displaying it. I've no idea why. I had expected it to run the command and display the results as it does via command line (whether directly or via script).
Can I know what command csf is using to call the script?
Can I know what command csf is using to call the script?
Re: lf_script_action command nesting?
I switched my shebang from bash to sh and all is working. Fair enough.
Thanks again for your help.
Thanks again for your help.