#!/bin/bash

# Change to the parent directory where your directories are located
cd /home/diab3973/scorm.cogitika.org

# Iterate through each directory
for dir in */; do
  # Navigate into the directory
  cd "$dir"

  # Check if there are zip files in the directory
  zip_files=$(find . -maxdepth 1 -type f -name "*.zip")

  if [ -n "$zip_files" ]; then
    # Unzip the files
    unzip -o *.zip
    echo "Unzipped files in $dir"

    # Delete the zip files
    rm -f *.zip
    echo "Deleted zip files in $dir"
  else
    echo "No zip files found in $dir"
  fi

  # Return to the parent directory
  cd ..
done