csf-post-docker
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.
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.
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.
Maybe this solution should be in the official README, I don't think I'm the only one who will run into this issue.