Skip to content

Commit bbf56a0

Browse files
committed
fix: don't run permissions checks when root or docker
1 parent 2257be4 commit bbf56a0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lgsm/functions/check_permissions.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ fn_sys_perm_fix_manually_msg() {
181181

182182
# Attempt to fix /sys related permission errors if sudo is available, exits otherwise.
183183
fn_sys_perm_errors_fix() {
184-
if sudo -n true > /dev/null 2>&1; then
184+
if sudo -n true >/dev/null 2>&1; then
185185
fn_print_dots "Automatically fixing /sys permissions"
186186
fn_script_log_info "Automatically fixing /sys permissions."
187187
if [ "${sysdirpermerror}" == "1" ]; then
@@ -223,10 +223,8 @@ fn_sys_perm_error_process() {
223223
fi
224224
}
225225

226-
# Run perm error detect & fix/alert functions on /sys directories.
227-
228-
## Run checks.
229-
if [ "$(whoami)" != "root" ] || [ -f /.dockerenv ]; then
226+
## Run permisions checks when not root or docker.
227+
if [ "$(whoami)" != "root" ] && [ ! -f /.dockerenv ]; then
230228
fn_check_ownership
231229
fn_check_permissions
232230
if [ "${commandname}" == "START" ]; then

0 commit comments

Comments
 (0)