fixing docker update
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 2s
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 2s
This commit is contained in:
@@ -23,8 +23,7 @@ send_error_notification() {
|
||||
-d "{\"caller\": \"$HOSTNAME\", \"message\": \"$message\", \"critical\": $critical}"
|
||||
}
|
||||
send_update_notification() {
|
||||
local message="$1"
|
||||
local script_time="$2"
|
||||
local script_time="$1"
|
||||
curl -s -X POST "$NOTIFY_URL_UPDATE" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"host\": \"$HOSTNAME\", \"asset\": \"Docker containers\", \"time\": $script_time}"
|
||||
@@ -218,37 +217,17 @@ update_all_docker_projects() {
|
||||
# Change to 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
|
||||
for project_dir in */; do
|
||||
if [[ -d "$project_dir" ]]; then
|
||||
local project_path="$DOCKER_FOLDER/$project_dir"
|
||||
|
||||
if update_docker_project "$project_path"; then
|
||||
if should_skip_container; then
|
||||
((skipped_count++))
|
||||
else
|
||||
((updated_count++))
|
||||
fi
|
||||
else
|
||||
((failed_count++))
|
||||
fi
|
||||
|
||||
update_docker_project "$project_path"
|
||||
|
||||
# Return to Docker folder for next iteration
|
||||
cd "$DOCKER_FOLDER" || die "Cannot return to Docker folder"
|
||||
fi
|
||||
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
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
|
Reference in New Issue
Block a user