Skip to content

Commit

Permalink
Add install-demo-certificates.sh usage in post-install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
QU3B1M committed Nov 12, 2024
1 parent 53f7839 commit e94a312
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions distribution/packages/src/deb/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ if command -v systemd-tmpfiles > /dev/null; then
systemd-tmpfiles --create wazuh-indexer.conf
fi

if ! [ -d "${config_dir}/certs" ] && [ -f "${product_dir}/plugins/opensearch-security/tools/install-demo-certificates.sh" ]; then
echo "No certificates detected in ${config_dir}, installing demo certificates..."
echo "### If you are using a custom certificates path, ignore this message."
bash "${product_dir}/plugins/opensearch-security/tools/install-demo-certificates.sh"
fi

if [ -f $restart_service ]; then
rm -f $restart_service
echo "Restarting wazuh-indexer service..."
Expand Down
6 changes: 6 additions & 0 deletions distribution/packages/src/rpm/wazuh-indexer.rpm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ if command -v systemd-tmpfiles > /dev/null; then
systemd-tmpfiles --create %{name}.conf
fi

if ! [ -d "${config_dir}/certs" ] && [ -f "${product_dir}/plugins/opensearch-security/tools/install-demo-certificates.sh" ]; then
echo "No certificates detected in ${config_dir}, installing demo certificates..."
echo "### If you are using a custom certificates path, ignore this message."
bash "${product_dir}/plugins/opensearch-security/tools/install-demo-certificates.sh"
fi

if [ -f %{tmp_dir}/wazuh-indexer.restart ]; then
rm -f %{tmp_dir}/wazuh-indexer.restart
if command -v systemctl > /dev/null; then
Expand Down

0 comments on commit e94a312

Please sign in to comment.