Merge pull request #320 from sptoothman/patch-1

Updated Makefile with a safety check for user
This commit is contained in:
Jason M. Wood 2022-11-28 21:42:50 -06:00 committed by GitHub
commit 336fb8386f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,12 @@ install: adduser update
fi
adduser:
useradd --system --user-group --create-home -K UMASK=0022 --home $(MSCS_HOME) $(MSCS_USER)
# safety check to see if user exists before trying to create it
if id $(MSCS_USER); then \
echo "Minecraft user $(MSCS_USER) exists so not creating it"; \
else \
useradd --system --user-group --create-home -K UMASK=0022 --home $(MSCS_HOME) $(MSCS_USER); \
fi
update:
install -m 0755 msctl $(MSCTL)