File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 3
3
# Please do not make any changes to this file, #
4
4
# change the variables in webui-user.sh instead #
5
5
# ################################################
6
+
6
7
# Read variables from webui-user.sh
7
8
# shellcheck source=/dev/null
8
9
if [[ -f webui-user.sh ]]
46
47
LAUNCH_SCRIPT=" launch.py"
47
48
fi
48
49
50
+ # this script cannot be run as root by default
51
+ can_run_as_root=0
52
+
53
+ # read any command line flags to the webui.sh script
54
+ while getopts " f" flag
55
+ do
56
+ case ${flag} in
57
+ f) can_run_as_root=1;;
58
+ esac
59
+ done
60
+
49
61
# Disable sentry logging
50
62
export ERROR_REPORTING=FALSE
51
63
@@ -61,7 +73,7 @@ printf "\e[1m\e[34mTested on Debian 11 (Bullseye)\e[0m"
61
73
printf " \n%s\n" " ${delimiter} "
62
74
63
75
# Do not run as root
64
- if [[ $( id -u) -eq 0 ]]
76
+ if [[ $( id -u) -eq 0 && can_run_as_root -eq 0 ]]
65
77
then
66
78
printf " \n%s\n" " ${delimiter} "
67
79
printf " \e[1m\e[31mERROR: This script must not be launched as root, aborting...\e[0m"
You can’t perform that action at this time.
0 commit comments