Skip to content

Commit

Permalink
Pick a safer filename
Browse files Browse the repository at this point in the history
  • Loading branch information
thespad committed Nov 27, 2024
1 parent 8d21fc1 commit 5b5888d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions root/etc/s6-overlay/s6-rc.d/init-adduser/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

if [[ ! -f "/usermod" ]] && [[ -n "${USER_NAME}" ]] && [[ "${USER_NAME}" != "abc" ]] && grep -q "^${USER_NAME}" /etc/passwd; then
if [[ ! -f "/usermod.done" ]] && [[ -n "${USER_NAME}" ]] && [[ "${USER_NAME}" != "abc" ]] && grep -q "^${USER_NAME}" /etc/passwd; then
echo "*** USER_NAME cannot be set to an user that already exists in /etc/passwd. Halting init. ***"
sleep infinity
else
Expand All @@ -14,7 +14,7 @@ PGID=${PGID:-911}
if [[ "$USER_NAME" != "abc" ]]; then
usermod -l "$USER_NAME" abc
groupmod -n "$USER_NAME" abc
touch /usermod
touch /usermod.done
fi

groupmod -o -g "$PGID" "$USER_NAME"
Expand Down

0 comments on commit 5b5888d

Please sign in to comment.