@@ -55,18 +55,38 @@ if [ ! -d $itdir ]; then mkdir $itdir; chmod 777 $itdir; fi
5555if [ ! -d $itdir ]; then error_exit " Failed to create $itdir " ; fi
5656
5757# Set user and group id
58+ it=$itdir /comfy_user_uid
59+ if [ -z " ${WANTED_UID+x} " ]; then
60+ if [ -f $it ]; then WANTED_UID=$( cat $it ) ; fi
61+ fi
5862WANTED_UID=${WANTED_UID:- 1024}
63+ if [ ! -f $it ]; then write_worldtmpfile $it " $WANTED_UID " ; fi
5964echo " -- WANTED_UID: \" ${WANTED_UID} \" "
6065
66+ it=$itdir /comfy_user_gid
67+ if [ -z " ${WANTED_GID+x} " ]; then
68+ if [ -f $it ]; then WANTED_GID=$( cat $it ) ; fi
69+ fi
6170WANTED_GID=${WANTED_GID:- 1024}
71+ if [ ! -f $it ]; then write_worldtmpfile $it " $WANTED_GID " ; fi
6272echo " -- WANTED_GID: \" ${WANTED_GID} \" "
6373
6474# Set security level
75+ it=$itdir /comfy_security_level
76+ if [ -z " ${SECURITY_LEVEL+x} " ]; then
77+ if [ -f $it ]; then SECURITY_LEVEL=$( cat $it ) ; fi
78+ fi
6579SECURITY_LEVEL=${SECURITY_LEVEL:- " normal" }
80+ if [ ! -f $it ]; then write_worldtmpfile $it " $SECURITY_LEVEL " ; fi
6681echo " -- SECURITY_LEVEL: \" ${SECURITY_LEVEL} \" "
6782
6883# Set base directory (if not used, set to $ignore_value)
84+ it=$itdir /comfy_base_directory
85+ if [ -z " ${BASE_DIRECTORY+x} " ]; then
86+ if [ -f $it ]; then BASE_DIRECTORY=$( cat $it ) ; fi
87+ fi
6988BASE_DIRECTORY=${BASE_DIRECTORY:- " $ignore_value " }
89+ if [ ! -f $it ]; then write_worldtmpfile $it " $BASE_DIRECTORY " ; fi
7090echo " -- BASE_DIRECTORY: \" ${BASE_DIRECTORY} \" "
7191
7292# Validate base directory
@@ -164,7 +184,7 @@ if [ "A${whoami}" == "Acomfytoo" ]; then
164184 echo " -- Running as comfytoo, will switch comfy to the desired UID/GID"
165185 # The script is started as comfytoo -- UID/GID 1025/1025
166186
167- FORCE_CHOWN=${FORCE_CHOWN:- " false" } # any value works, empty value or false means disabled
187+ FORCE_CHOWN=${FORCE_CHOWN:- " false" } # any value works, empty value or false means disabled
168188 if [ " A${FORCE_CHOWN} " != " Afalse" ]; then
169189 echo " -- Force chown mode enabled, will force change directory ownership as comfy user during script rerun (might be slow)"
170190 sudo touch /etc/comfy_force_chown
0 commit comments