Skip to content

Commit

Permalink
Merge pull request #1956 from wazuh/user-error-solaris
Browse files Browse the repository at this point in the history
Fix error when creating user in Solaris 10
  • Loading branch information
alberpilot authored and jnasselle committed Apr 19, 2023
1 parent 8078c00 commit 7f7bc0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions solaris/solaris10/postremove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# postremove script for wazuh-agent
# Wazuh, Inc 2015

if getent passwd wazuh; then
if getent passwd wazuh > /dev/null 2>&1; then
userdel wazuh
fi

if getent group wazuh; then
if getent group wazuh > /dev/null 2>&1; then
groupdel wazuh
fi
8 changes: 4 additions & 4 deletions solaris/solaris10/preinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ if [ ! -f ${OSMYSHELL} ]; then
fi
fi

getent group | grep "^wazuh"
if [ "$?" -eq 1 ]; then
getent group wazuh > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
groupadd ${GROUP}
fi

getent passwd wazuh
if [ "$?" -eq 1 ]; then
getent passwd wazuh > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
useradd -d ${DIR} -s ${OSMYSHELL} -g ${GROUP} ${USER} > /dev/null 2>&1
fi

Expand Down

0 comments on commit 7f7bc0a

Please sign in to comment.