File tree Expand file tree Collapse file tree 7 files changed +9
-9
lines changed Expand file tree Collapse file tree 7 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 21
21
22
22
check_tmuxception.sh
23
23
24
- if [ " $( whoami) " != " root" ] || [ -f /.dockerenv ] ; then
24
+ if [ " $( whoami) " != " root" ]; then
25
25
if [ " ${commandname} " != " MONITOR" ]; then
26
26
check_permissions.sh
27
27
fi
@@ -38,7 +38,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do
38
38
fi
39
39
done
40
40
41
- if [ " $( whoami) " != " root" ] || [ -f /.dockerenv ] ; then
41
+ if [ " $( whoami) " != " root" ]; then
42
42
allowed_commands_array=(DEBUG START INSTALL)
43
43
for allowed_command in " ${allowed_commands_array[@]} " ; do
44
44
if [ " ${allowed_command} " == " ${commandname} " ]; then
Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ fn_deps_detector() {
301
301
}
302
302
303
303
if [ " ${commandname} " == " INSTALL" ]; then
304
- if [ " $( whoami) " == " root" ] && [ ! -f /.dockerenv ] ; then
304
+ if [ " $( whoami) " == " root" ]; then
305
305
echo -e " "
306
306
echo -e " ${lightyellow} Checking Dependencies as root${default} "
307
307
echo -e " ================================="
Original file line number Diff line number Diff line change @@ -223,8 +223,8 @@ fn_sys_perm_error_process() {
223
223
fi
224
224
}
225
225
226
- # # Run permisions checks when not root or docker .
227
- if [ " $( whoami) " != " root" ] && [ ! -f /.dockerenv ] ; then
226
+ # # Run permisions checks when not root.
227
+ if [ " $( whoami) " != " root" ]; then
228
228
fn_check_ownership
229
229
fn_check_permissions
230
230
if [ " ${commandname} " == " START" ]; then
Original file line number Diff line number Diff line change 7
7
8
8
moduleselfname=" $( basename " $( readlink -f " ${BASH_SOURCE[0]} " ) " ) "
9
9
10
- if [ " $( whoami) " == " root" ] && [ ! -f /.dockerenv ] ; then
10
+ if [ " $( whoami) " == " root" ]; then
11
11
if [ " ${commandname} " != " INSTALL" ]; then
12
12
fn_print_fail_nl " Do NOT run this script as root!"
13
13
if [ -d " ${lgsmlogdir} " ]; then
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
11
11
fn_firstcommand_set
12
12
13
13
check.sh
14
- if [ " $( whoami) " == " root" ] && [ ! -f /.dockerenv ] ; then
14
+ if [ " $( whoami) " == " root" ]; then
15
15
check_deps.sh
16
16
else
17
17
install_header.sh
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ fn_exit_dev_debug() {
18
18
}
19
19
20
20
# If running dependency check as root will remove any files that belong to root user.
21
- if [ " $( whoami) " == " root" ] && [ ! -f /.dockerenv ] ; then
21
+ if [ " $( whoami) " == " root" ]; then
22
22
find " ${lgsmdir} " / -group root -prune -exec rm -rf {} + > /dev/null 2>&1
23
23
find " ${logdir} " / -group root -prune -exec rm -rf {} + > /dev/null 2>&1
24
24
fi
Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ fn_install_file() {
321
321
}
322
322
323
323
# Prevent LinuxGSM from running as root. Except if doing a dependency install.
324
- if [ " $( whoami) " == " root" ] && [ ! -f /.dockerenv ] ; then
324
+ if [ " $( whoami) " == " root" ]; then
325
325
if [ " ${userinput} " == " install" ] || [ " ${userinput} " == " auto-install" ] || [ " ${userinput} " == " i" ] || [ " ${userinput} " == " ai" ]; then
326
326
if [ " ${shortname} " == " core" ]; then
327
327
echo -e " [ FAIL ] Do NOT run this script as root!"
You can’t perform that action at this time.
0 commit comments