Pose a warning for selinux, but don't exit

This commit is contained in:
Louis Abel 2024-12-15 17:11:28 -07:00
parent 5454ef7c86
commit b8ace1a10a
Signed by: label
GPG Key ID: 2A6975660E424560
5 changed files with 20 additions and 10 deletions

View File

@ -6,6 +6,8 @@
set -o errexit
set -o pipefail
YELLOW=$(tput setaf 3)
NORMAL=$(tput sgr0)
SCRNAME="$(basename "$0")"
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
@ -53,8 +55,8 @@ fi
if [ -e "/sys/fs/selinux/enforce" ]; then
enforce_check="$(cat /sys/fs/selinux/enforce)"
if [ "$enforce_check" -eq "1" ]; then
echo "Running with selinux enforcing is not recommended."
exit 22
printf "${YELLOW}WARNING:${NORMAL} Running with selinux enforcing may cause issues with the final image.\n"
printf "Proceed at your own risk.\n"
fi
fi

View File

@ -6,6 +6,8 @@
set -o errexit
set -o pipefail
YELLOW=$(tput setaf 3)
NORMAL=$(tput sgr0)
SCRNAME="$(basename "$0")"
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
@ -53,8 +55,8 @@ fi
if [ -e "/sys/fs/selinux/enforce" ]; then
enforce_check="$(cat /sys/fs/selinux/enforce)"
if [ "$enforce_check" -eq "1" ]; then
echo "Running with selinux enforcing is not recommended."
exit 22
printf "${YELLOW}WARNING:${NORMAL} Running with selinux enforcing may cause issues with the final image.\n"
printf "Proceed at your own risk.\n"
fi
fi

View File

@ -6,6 +6,8 @@
set -o errexit
set -o pipefail
YELLOW=$(tput setaf 3)
NORMAL=$(tput sgr0)
SCRNAME="$(basename "$0")"
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
@ -55,8 +57,8 @@ fi
if [ -e "/sys/fs/selinux/enforce" ]; then
enforce_check="$(cat /sys/fs/selinux/enforce)"
if [ "$enforce_check" -eq "1" ]; then
echo "Running with selinux enforcing is not recommended."
exit 22
printf "${YELLOW}WARNING:${NORMAL} Running with selinux enforcing may cause issues with the final image.\n"
printf "Proceed at your own risk.\n"
fi
fi

View File

@ -6,6 +6,8 @@
set -o errexit
set -o pipefail
YELLOW=$(tput setaf 3)
NORMAL=$(tput sgr0)
SCRNAME="$(basename "$0")"
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
@ -53,8 +55,8 @@ fi
if [ -e "/sys/fs/selinux/enforce" ]; then
enforce_check="$(cat /sys/fs/selinux/enforce)"
if [ "$enforce_check" -eq "1" ]; then
echo "Running with selinux enforcing is not recommended."
exit 22
printf "${YELLOW}WARNING:${NORMAL} Running with selinux enforcing may cause issues with the final image.\n"
printf "Proceed at your own risk.\n"
fi
fi

View File

@ -6,6 +6,8 @@
set -o errexit
set -o pipefail
YELLOW=$(tput setaf 3)
NORMAL=$(tput sgr0)
SCRNAME="$(basename "$0")"
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
@ -53,8 +55,8 @@ fi
if [ -e "/sys/fs/selinux/enforce" ]; then
enforce_check="$(cat /sys/fs/selinux/enforce)"
if [ "$enforce_check" -eq "1" ]; then
echo "Running with selinux enforcing is not recommended."
exit 22
printf "${YELLOW}WARNING:${NORMAL} Running with selinux enforcing may cause issues with the final image.\n"
printf "Proceed at your own risk.\n"
fi
fi