selinux: fix output consistency

install mode was silent when selinux was not enabled, whilst remove mode
always output a "Begin unmounting..." message. this makes both modes silent
when selinux is not enabled.

this also happens to fix an unintended side effect of
d79c96232b whereby a warning subsequently
was always emitted in remove mode when selinux was not in use, which was
not ideal.

Gbp-Dch: Short
This commit is contained in:
Lyndon Brown 2020-04-25 03:25:32 +01:00 committed by Raphaël Hertzog
parent 931f42fa39
commit 80d9c93de9
1 changed files with 18 additions and 14 deletions

View File

@ -24,10 +24,15 @@ Init_config_data "${@}"
# Requiring stage file
Require_stagefiles config bootstrap
# Skip if selinux is not enabled
if [ ! -e /sys/fs/selinux/enforce ] || [ "$(cat /sys/fs/selinux/enforce)" != "1" ]
then
Echo_debug "Skipping due to selinux being disabled..."
exit 0
fi
case "${1}" in
install)
if [ -e /sys/fs/selinux/enforce ] && [ "$(cat /sys/fs/selinux/enforce)" = "1" ]
then
Echo_message "Begin mounting /sys/fs/selinux..."
# Checking stage file
@ -44,7 +49,6 @@ case "${1}" in
# Creating stage file
Create_stagefile
fi
;;
remove)