Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yenienserrano committed Dec 22, 2023
1 parent 6ac9c23 commit 17ac65c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dev-tools/test-packages/test-packages.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#!/bin/sh

# Definir el nombre del contenedor y los archivos que se van a verificar
# Package name
PACKAGE=""
# Container name
CONTAINER_NAME="wazuh-dashboard"
# Files to check
FILES="/etc/wazuh-dashboard/opensearch_dashboards.yml /usr/share/wazuh-dashboard"
# Owner of the files
FILE_OWNER="wazuh-dashboard"

# Remove container and image
clean() {
docker stop $CONTAINER_NAME
docker rmi $CONTAINER_NAME
}

# Check if files exist and are owned by wazuh-dashboard
files_exist() {
for FILE in $FILES; do
if docker exec $CONTAINER_NAME ls $FILE >/dev/null 2>&1; then
Expand All @@ -29,7 +34,7 @@ files_exist() {
done
}


# Run test
test() {

if [[ $PACKAGE == *".deb" ]]; then
Expand All @@ -46,7 +51,7 @@ test() {
files_exist
}


# Show help
help() {
echo
echo "Usage: $0 [OPTIONS]"
Expand Down

0 comments on commit 17ac65c

Please sign in to comment.