csfpost.sh doesn't use shebang
Posted: 26 Jan 2018, 08:47
It seems that csf runs csfpost.sh with sh instead of just using the shebang that was specified. This causes some unexpected behaviour if you need more logic in these files.
I can only reproduce this on Ubuntu, CentOS has no problems. I've added the following code to csfpost.sh:
I can only reproduce this on Ubuntu, CentOS has no problems. I've added the following code to csfpost.sh:
Code: Select all
#!/bin/bash
if [ ! "$BASH_VERSION" ] ; then
echo "Please do not use sh to run this script ($0)"
fi
Code: Select all
Running /etc/csf/csfpost.sh
Please do not use sh to run this script (/etc/csf/csfpost.sh)