fixing docker update
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 37s
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 37s
This commit is contained in:
@@ -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,25 +217,13 @@ 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
|
||||||
|
Reference in New Issue
Block a user