mirror of
https://github.com/MinecraftServerControl/mscs.git
synced 2024-11-14 22:38:18 -07:00
Updated Makefile with a safety check for user
Added a safety check to see if the user exists when running make install. It was dying on me because the user already existed. Now if the user exists, it reports back the user exists and skips it.
This commit is contained in:
parent
915b271f2d
commit
86bde27736
7
Makefile
7
Makefile
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user