mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-29 06:54:59 +00:00
fix: Correct SELinux boolean parsing and add loop break
- Fixed incorrect parsing of `container_use_devices` boolean by changing the awk field from `$2` to `$3` to retrieve the correct value. - Added a `break` statement after enabling the SELinux boolean to prevent unnecessary loop iterations after user prompt. Signed-off-by: Alessandro Pirastru <alessandro.pirastru.94@gmail.com>
This commit is contained in:
parent
a0ebb55b3f
commit
eef553f3be
1 changed files with 3 additions and 1 deletions
4
docs/static/install.sh
vendored
4
docs/static/install.sh
vendored
|
@ -317,7 +317,7 @@ enable_selinux_container_booleans() {
|
||||||
|
|
||||||
if [ "$SELINUX_MODE" == "Enforcing" ]; then
|
if [ "$SELINUX_MODE" == "Enforcing" ]; then
|
||||||
# Check the status of container_use_devices
|
# Check the status of container_use_devices
|
||||||
CONTAINER_USE_DEVICES=$(getsebool container_use_devices | awk '{print $2}')
|
CONTAINER_USE_DEVICES=$(getsebool container_use_devices | awk '{print $3}')
|
||||||
|
|
||||||
if [ "$CONTAINER_USE_DEVICES" == "off" ]; then
|
if [ "$CONTAINER_USE_DEVICES" == "off" ]; then
|
||||||
|
|
||||||
|
@ -339,6 +339,8 @@ enable_selinux_container_booleans() {
|
||||||
if [ "$Answer" = "yes" ]; then
|
if [ "$Answer" = "yes" ]; then
|
||||||
warn "Enabling \"container_use_devices\" persistently..."
|
warn "Enabling \"container_use_devices\" persistently..."
|
||||||
$SUDO setsebool -P container_use_devices 1
|
$SUDO setsebool -P container_use_devices 1
|
||||||
|
|
||||||
|
break
|
||||||
elif [ "$Answer" = "exit" ]; then
|
elif [ "$Answer" = "exit" ]; then
|
||||||
aborted
|
aborted
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue