Print all SELINUX output in lowercase

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2022-07-10 13:08:33 +02:00
parent e0baf4c7ec
commit b25805348f

View file

@ -2050,22 +2050,22 @@ checkSelinux() {
DEFAULT_SELINUX=$(awk -F= '/^SELINUX=/ {print $2}' /etc/selinux/config) DEFAULT_SELINUX=$(awk -F= '/^SELINUX=/ {print $2}' /etc/selinux/config)
case "${DEFAULT_SELINUX,,}" in case "${DEFAULT_SELINUX,,}" in
enforcing) enforcing)
printf " %b %bDefault SELinux: %s%b\\n" "${CROSS}" "${COL_RED}" "${DEFAULT_SELINUX}" "${COL_NC}" printf " %b %bDefault SELinux: %s%b\\n" "${CROSS}" "${COL_RED}" "${DEFAULT_SELINUX,,}" "${COL_NC}"
SELINUX_ENFORCING=1 SELINUX_ENFORCING=1
;; ;;
*) # 'permissive' and 'disabled' *) # 'permissive' and 'disabled'
printf " %b %bDefault SELinux: %s%b\\n" "${TICK}" "${COL_GREEN}" "${DEFAULT_SELINUX}" "${COL_NC}" printf " %b %bDefault SELinux: %s%b\\n" "${TICK}" "${COL_GREEN}" "${DEFAULT_SELINUX,,}" "${COL_NC}"
;; ;;
esac esac
# Check the current state of SELinux # Check the current state of SELinux
CURRENT_SELINUX=$(getenforce) CURRENT_SELINUX=$(getenforce)
case "${CURRENT_SELINUX,,}" in case "${CURRENT_SELINUX,,}" in
enforcing) enforcing)
printf " %b %bCurrent SELinux: %s%b\\n" "${CROSS}" "${COL_RED}" "${CURRENT_SELINUX}" "${COL_NC}" printf " %b %bCurrent SELinux: %s%b\\n" "${CROSS}" "${COL_RED}" "${CURRENT_SELINUX,,}" "${COL_NC}"
SELINUX_ENFORCING=1 SELINUX_ENFORCING=1
;; ;;
*) # 'permissive' and 'disabled' *) # 'permissive' and 'disabled'
printf " %b %bCurrent SELinux: %s%b\\n" "${TICK}" "${COL_GREEN}" "${CURRENT_SELINUX}" "${COL_NC}" printf " %b %bCurrent SELinux: %s%b\\n" "${TICK}" "${COL_GREEN}" "${CURRENT_SELINUX,,}" "${COL_NC}"
;; ;;
esac esac
else else