csf-post-docker icon indicating copy to clipboard operation
csf-post-docker copied to clipboard

Script is not running correctly when CSF refreshes the rules automatically, but works fine when used together with csf -r.

Open panomitrius opened this issue 4 years ago • 2 comments

This script is not running correctly when CSF refreshes the rules automatically, but works fine when used together with csf -r. According to the CSF readme any binaries inside such a script as this must be run with full paths provided:

Note: While csf runs the script with a preset PATH, you MUST use the full path to any binaries that you execute within these scripts to ensure they are run correctly

This post also mentions the full path criteria. I'll test that myself when I have time to monitor the effects.

panomitrius avatar Dec 20 '20 13:12 panomitrius

Confirming that adding the full path to each iptables and docker command in the script makes it work fine. In my case on Ubuntu 20.04 it's /usr/sbin/iptables and /usr/bin/docker.

panomitrius avatar Jan 02 '21 08:01 panomitrius

Maybe this solution should be in the official README, I don't think I'm the only one who will run into this issue.

panomitrius avatar Jan 02 '21 11:01 panomitrius