Trying to fix the creation of the user, updating to version 1.1.3

This commit is contained in:
Alejandro Lembke Barrientos 2024-02-14 17:51:26 +00:00
parent f9351861bd
commit c17566fd5f
2 changed files with 3 additions and 9 deletions

View File

@ -25,7 +25,7 @@ then
else
echo "INFO: Group doesn't exist; creating..."
# create the group
addgroup -g "${MY_GID}" "${MY_GROUP}" || (echo "INFO: Group exists but with a different name; renaming..."; groupmod -g "${MY_GID}" -n "${MY_GROUP}" "$(awk -F ':' '{print $1":"$3}' < /etc/group | grep ":${MY_GID}$" | awk -F ":" '{print $1}')")
sudo addgroup -g "${MY_GID}" "${MY_GROUP}" || (echo "INFO: Group exists but with a different name; renaming..."; sudo groupmod -g "${MY_GID}" -n "${MY_GROUP}" "$(awk -F ':' '{print $1":"$3}' < /etc/group | grep ":${MY_GID}$" | awk -F ":" '{print $1}')")
fi
@ -36,15 +36,9 @@ then
else
echo "INFO: User doesn't exist; creating..."
# create the user
adduser -u "${MY_UID}" -G "${MY_GROUP}" -h "/home/${HOME_USER}" -s /bin/sh -D "${HOME_USER}"
sudo adduser -u "${MY_UID}" -G "${MY_GROUP}" -h "/home/${HOME_USER}" -s /bin/sh -D "${HOME_USER}"
fi
# make the directories needed to run my app
mkdir -p /opt/myapp
# change ownership of any directories needed to run my app as the proper UID/GID
chown -R "${HOME_USER}:${MY_GROUP}" "/opt/myapp"
# addgroup nonroot
#adduser --disabled-password --gecos "" ${HOME_USER}
# echo "${HOME_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

View File

@ -1 +1 @@
1.1.2
1.1.3