diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-11-27 11:17:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 11:17:44 +0000 |
commit | 88a01f94a820a34569ec954e98da0f93aaa3cbb3 (patch) | |
tree | a08427dec2beb0eeea1962bf859bc48b64657d8a /webui.sh | |
parent | eb085501080a6ee76caa3b19c6990348e60fc5c9 (diff) | |
parent | 065364445d4ea1ddec44c3f87d1b6b8acda592a6 (diff) | |
download | stable-diffusion-webui-gfx803-88a01f94a820a34569ec954e98da0f93aaa3cbb3.tar.gz stable-diffusion-webui-gfx803-88a01f94a820a34569ec954e98da0f93aaa3cbb3.tar.bz2 stable-diffusion-webui-gfx803-88a01f94a820a34569ec954e98da0f93aaa3cbb3.zip |
Merge pull request #1904 from EternalNooblet/dev
Added a flag to run as root if needed
Diffstat (limited to 'webui.sh')
-rwxr-xr-x | webui.sh | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -3,6 +3,7 @@ # Please do not make any changes to this file, # # change the variables in webui-user.sh instead # ################################################# + # Read variables from webui-user.sh # shellcheck source=/dev/null if [[ -f webui-user.sh ]] @@ -46,6 +47,17 @@ then LAUNCH_SCRIPT="launch.py" fi +# this script cannot be run as root by default +can_run_as_root=0 + +# read any command line flags to the webui.sh script +while getopts "f" flag +do + case ${flag} in + f) can_run_as_root=1;; + esac +done + # Disable sentry logging export ERROR_REPORTING=FALSE @@ -61,7 +73,7 @@ printf "\e[1m\e[34mTested on Debian 11 (Bullseye)\e[0m" printf "\n%s\n" "${delimiter}" # Do not run as root -if [[ $(id -u) -eq 0 ]] +if [[ $(id -u) -eq 0 && can_run_as_root -eq 0 ]] then printf "\n%s\n" "${delimiter}" printf "\e[1m\e[31mERROR: This script must not be launched as root, aborting...\e[0m" |