#!/usr/bin/env bash CHANGES_PRODUCED=false # Put here all apk update scripts UPDATE_SCRIPTS=( "./scripts/apk-update-scripts/sheetless.sh" ) for script in "${UPDATE_SCRIPTS[@]}"; do echo "--------------------------------" echo "Executing: $script" # Run the script $script # Capture the exit code immediately if [ $? -eq 10 ]; then echo " -> $script returned 10 (change)" CHANGES_PRODUCED=true fi done echo "--------------------------------" if [ "$CHANGES_PRODUCED" = true ]; then echo "Result: At least one script produced a change" exit 10 else echo "Result: Not script produced a change" exit 0 fi