File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,13 +26,17 @@ if [[ "$SANDBOX_USER_ID" -eq 0 ]]; then
2626 " $@ "
2727else
2828 echo " Setting up enduser with id $SANDBOX_USER_ID "
29- if ! useradd -l -m -u $SANDBOX_USER_ID -s /bin/bash enduser; then
30- echo " Failed to create user enduser with id $SANDBOX_USER_ID . Moving opendevin user."
31- incremented_id=$(( $SANDBOX_USER_ID + 1 ))
32- usermod -u $incremented_id opendevin
29+ if id " enduser" & > /dev/null; then
30+ echo " User enduser already exists. Skipping creation."
31+ else
3332 if ! useradd -l -m -u $SANDBOX_USER_ID -s /bin/bash enduser; then
34- echo " Failed to create user enduser with id $SANDBOX_USER_ID for a second time. Exiting."
35- exit 1
33+ echo " Failed to create user enduser with id $SANDBOX_USER_ID . Moving opendevin user."
34+ incremented_id=$(( $SANDBOX_USER_ID + 1 ))
35+ usermod -u $incremented_id opendevin
36+ if ! useradd -l -m -u $SANDBOX_USER_ID -s /bin/bash enduser; then
37+ echo " Failed to create user enduser with id $SANDBOX_USER_ID for a second time. Exiting."
38+ exit 1
39+ fi
3640 fi
3741 fi
3842 usermod -aG app enduser
You can’t perform that action at this time.
0 commit comments