fixing docker update
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 2s

This commit is contained in:
2025-08-24 21:07:13 -03:00
parent 1489062943
commit c34ee5185d

View File

@@ -23,8 +23,7 @@ send_error_notification() {
-d "{\"caller\": \"$HOSTNAME\", \"message\": \"$message\", \"critical\": $critical}" -d "{\"caller\": \"$HOSTNAME\", \"message\": \"$message\", \"critical\": $critical}"
} }
send_update_notification() { send_update_notification() {
local message="$1" local script_time="$1"
local script_time="$2"
curl -s -X POST "$NOTIFY_URL_UPDATE" \ curl -s -X POST "$NOTIFY_URL_UPDATE" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{\"host\": \"$HOSTNAME\", \"asset\": \"Docker containers\", \"time\": $script_time}" -d "{\"host\": \"$HOSTNAME\", \"asset\": \"Docker containers\", \"time\": $script_time}"
@@ -218,37 +217,17 @@ update_all_docker_projects() {
# Change to Docker folder # Change to Docker folder
cd "$DOCKER_FOLDER" || die "Cannot access Docker folder: $DOCKER_FOLDER" cd "$DOCKER_FOLDER" || die "Cannot access Docker folder: $DOCKER_FOLDER"
local updated_count=0
local failed_count=0
local skipped_count=0
# Process each subdirectory # Process each subdirectory
for project_dir in */; do for project_dir in */; do
if [[ -d "$project_dir" ]]; then if [[ -d "$project_dir" ]]; then
local project_path="$DOCKER_FOLDER/$project_dir" local project_path="$DOCKER_FOLDER/$project_dir"
if update_docker_project "$project_path"; then update_docker_project "$project_path"
if should_skip_container; then
((skipped_count++))
else
((updated_count++))
fi
else
((failed_count++))
fi
# Return to Docker folder for next iteration # Return to Docker folder for next iteration
cd "$DOCKER_FOLDER" || die "Cannot return to Docker folder" cd "$DOCKER_FOLDER" || die "Cannot return to Docker folder"
fi fi
done done
# Report results
log_success "Docker update summary:"
log_info " Updated: $updated_count projects"
log_info " Skipped: $skipped_count projects"
if [[ $failed_count -gt 0 ]]; then
log_warning " Failed: $failed_count projects"
fi
} }
#============================================================================== #==============================================================================