Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added sanity check to avoid cosmetics errors when selinux is not present #51

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cf-nginx-ip-passthrough/cf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ placeConf(){
}

isSeEnforcing(){
seMode=$(getenforce)
if [ ! -z `which getenforce` ] ; then # To avoid cosmetic errors when there are no Selinux binaries
seMode=$(getenforce)
fi
if [ "$seMode" == "Enforcing" ] ; then
echo "1"
else
Expand All @@ -49,7 +51,7 @@ if [ ! -f $cfConfig ] ; then
# CF IP List is missing in conf.d
placeConf
else
# CF IP List exists in conf.d
# CF IP List exists in conf.d
if [[ ! -z "$(cat $cfConfig)" ]] ; then
# The list is not empty. Back up the previous one and install the new one.
cp $cfConfig{,.bkp} && placeConf
Expand Down Expand Up @@ -84,4 +86,3 @@ fi


exit 0