Skip to content

Commit

Permalink
fix: addressed requested changes and removed deprecated installation …
Browse files Browse the repository at this point in the history
…scripts
  • Loading branch information
mjcr99 committed Aug 8, 2024
1 parent ce42310 commit 628b208
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 24 deletions.
2 changes: 0 additions & 2 deletions packages/debs/SPECS/wazuh-agent/debian/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ case "$1" in
;;

failed-upgrade)
if [ -f ]; then

fi
;;

*)
Expand Down
2 changes: 1 addition & 1 deletion packages/debs/SPECS/wazuh-manager/debian/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ case "$1" in
if [ -f /etc/ossec-init.conf ]; then
. /etc/ossec-init.conf
else
VERSION=$(${DIR}/bin/wazuh-control info -v)
VERSION=$(${DIR}/bin/wazuh-control info -v)
fi

# Get the major and minor version
Expand Down
7 changes: 7 additions & 0 deletions packages/macos/package_files/preinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ if [ -d "${DIR}" ]; then
=======
touch "${DIR}/WAZUH_PKG_UPGRADE"
upgrade="true"
<<<<<<< HEAD

if | grep "is running" > /dev/null 2>&1; then
>>>>>>> 058865e67c (refactor: removed references to deprecated daemons in packages files)
Expand All @@ -46,6 +47,9 @@ if [ -d "${DIR}" ]; then
${DIR}/bin/ossec-control stop
restart="true"
fi
=======
fi
>>>>>>> cff2779e10 (fix: addressed requested changes and removed deprecated installation scripts)

<<<<<<< HEAD
=======
Expand Down Expand Up @@ -112,6 +116,7 @@ if [[ ${new_uid} != ${new_gid} ]]
exit 5;
fi

<<<<<<< HEAD
<<<<<<< HEAD
=======
# Stops the agent before upgrading it
Expand All @@ -120,6 +125,8 @@ elif [ -f ]; then
fi

>>>>>>> 058865e67c (refactor: removed references to deprecated daemons in packages files)
=======
>>>>>>> cff2779e10 (fix: addressed requested changes and removed deprecated installation scripts)
# Creating the group
echo "Checking group..."
if [[ $(dscl . -read /Groups/wazuh) ]]
Expand Down
4 changes: 2 additions & 2 deletions packages/rpms/SPECS/wazuh-manager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ if [ $1 = 2 ]; then
. %{_sysconfdir}/ossec-init.conf
else
# Ask wazuh-control the version
VERSION=$()
VERSION=$(%{_localstatedir}/bin/wazuh-control info -v)
fi

# Get the major and minor version
Expand Down Expand Up @@ -293,7 +293,7 @@ fi

%post

echo "VERSION=\"$()\"" > /etc/ossec-init.conf
echo "VERSION=\"$(%{_localstatedir}/bin/wazuh-control info -v)\"" > /etc/ossec-init.conf

# Upgrade install code block
if [ $1 = 2 ]; then
Expand Down
21 changes: 2 additions & 19 deletions src/init/inst-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -752,25 +752,8 @@ InstallCommon()
WAZUH_GROUP='wazuh'
WAZUH_USER='wazuh'
INSTALL="install"

if [ ${INSTYPE} = 'server' ]; then
OSSEC_CONTROL_SRC='./init/wazuh-server.sh'
OSSEC_CONF_SRC='../etc/ossec-server.conf'
elif [ ${INSTYPE} = 'agent' ]; then
OSSEC_CONTROL_SRC='./init/wazuh-client.sh'
OSSEC_CONF_SRC='../etc/ossec-agent.conf'
elif [ ${INSTYPE} = 'local' ]; then
OSSEC_CONTROL_SRC='./init/wazuh-local.sh'
OSSEC_CONF_SRC='../etc/ossec-local.conf'
fi

if [ ${DIST_NAME} = "sunos" ]; then
INSTALL="ginstall"
elif [ ${DIST_NAME} = "HP-UX" ]; then
INSTALL="/usr/local/coreutils/bin/install"
elif [ ${DIST_NAME} = "AIX" ]; then
INSTALL="/opt/freeware/bin/install"
fi
OSSEC_CONTROL_SRC='./init/wazuh-server.sh'
OSSEC_CONF_SRC='../etc/ossec-server.conf'

./init/adduser.sh ${WAZUH_USER} ${WAZUH_GROUP} ${INSTALLDIR}

Expand Down

0 comments on commit 628b208

Please sign in to comment.