Pose a warning for selinux, but don't exit
This commit is contained in:
parent
5454ef7c86
commit
b8ace1a10a
5 changed files with 20 additions and 10 deletions
|
@ -6,6 +6,8 @@
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
YELLOW=$(tput setaf 3)
|
||||||
|
NORMAL=$(tput sgr0)
|
||||||
SCRNAME="$(basename "$0")"
|
SCRNAME="$(basename "$0")"
|
||||||
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
|
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
@ -53,8 +55,8 @@ fi
|
||||||
if [ -e "/sys/fs/selinux/enforce" ]; then
|
if [ -e "/sys/fs/selinux/enforce" ]; then
|
||||||
enforce_check="$(cat /sys/fs/selinux/enforce)"
|
enforce_check="$(cat /sys/fs/selinux/enforce)"
|
||||||
if [ "$enforce_check" -eq "1" ]; then
|
if [ "$enforce_check" -eq "1" ]; then
|
||||||
echo "Running with selinux enforcing is not recommended."
|
printf "${YELLOW}WARNING:${NORMAL} Running with selinux enforcing may cause issues with the final image.\n"
|
||||||
exit 22
|
printf "Proceed at your own risk.\n"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
YELLOW=$(tput setaf 3)
|
||||||
|
NORMAL=$(tput sgr0)
|
||||||
SCRNAME="$(basename "$0")"
|
SCRNAME="$(basename "$0")"
|
||||||
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
|
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
@ -53,8 +55,8 @@ fi
|
||||||
if [ -e "/sys/fs/selinux/enforce" ]; then
|
if [ -e "/sys/fs/selinux/enforce" ]; then
|
||||||
enforce_check="$(cat /sys/fs/selinux/enforce)"
|
enforce_check="$(cat /sys/fs/selinux/enforce)"
|
||||||
if [ "$enforce_check" -eq "1" ]; then
|
if [ "$enforce_check" -eq "1" ]; then
|
||||||
echo "Running with selinux enforcing is not recommended."
|
printf "${YELLOW}WARNING:${NORMAL} Running with selinux enforcing may cause issues with the final image.\n"
|
||||||
exit 22
|
printf "Proceed at your own risk.\n"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
YELLOW=$(tput setaf 3)
|
||||||
|
NORMAL=$(tput sgr0)
|
||||||
SCRNAME="$(basename "$0")"
|
SCRNAME="$(basename "$0")"
|
||||||
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
|
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
@ -55,8 +57,8 @@ fi
|
||||||
if [ -e "/sys/fs/selinux/enforce" ]; then
|
if [ -e "/sys/fs/selinux/enforce" ]; then
|
||||||
enforce_check="$(cat /sys/fs/selinux/enforce)"
|
enforce_check="$(cat /sys/fs/selinux/enforce)"
|
||||||
if [ "$enforce_check" -eq "1" ]; then
|
if [ "$enforce_check" -eq "1" ]; then
|
||||||
echo "Running with selinux enforcing is not recommended."
|
printf "${YELLOW}WARNING:${NORMAL} Running with selinux enforcing may cause issues with the final image.\n"
|
||||||
exit 22
|
printf "Proceed at your own risk.\n"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
YELLOW=$(tput setaf 3)
|
||||||
|
NORMAL=$(tput sgr0)
|
||||||
SCRNAME="$(basename "$0")"
|
SCRNAME="$(basename "$0")"
|
||||||
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
|
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
@ -53,8 +55,8 @@ fi
|
||||||
if [ -e "/sys/fs/selinux/enforce" ]; then
|
if [ -e "/sys/fs/selinux/enforce" ]; then
|
||||||
enforce_check="$(cat /sys/fs/selinux/enforce)"
|
enforce_check="$(cat /sys/fs/selinux/enforce)"
|
||||||
if [ "$enforce_check" -eq "1" ]; then
|
if [ "$enforce_check" -eq "1" ]; then
|
||||||
echo "Running with selinux enforcing is not recommended."
|
printf "${YELLOW}WARNING:${NORMAL} Running with selinux enforcing may cause issues with the final image.\n"
|
||||||
exit 22
|
printf "Proceed at your own risk.\n"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
YELLOW=$(tput setaf 3)
|
||||||
|
NORMAL=$(tput sgr0)
|
||||||
SCRNAME="$(basename "$0")"
|
SCRNAME="$(basename "$0")"
|
||||||
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
|
SCRDIR="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
@ -53,8 +55,8 @@ fi
|
||||||
if [ -e "/sys/fs/selinux/enforce" ]; then
|
if [ -e "/sys/fs/selinux/enforce" ]; then
|
||||||
enforce_check="$(cat /sys/fs/selinux/enforce)"
|
enforce_check="$(cat /sys/fs/selinux/enforce)"
|
||||||
if [ "$enforce_check" -eq "1" ]; then
|
if [ "$enforce_check" -eq "1" ]; then
|
||||||
echo "Running with selinux enforcing is not recommended."
|
printf "${YELLOW}WARNING:${NORMAL} Running with selinux enforcing may cause issues with the final image.\n"
|
||||||
exit 22
|
printf "Proceed at your own risk.\n"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue