#!/bin/bash BASEDIR=/var/www/www.lema.org cd $BASEDIR # Recreate the zip file with only .md and .adoc files, preserving subfolders # but not the "content/" folder (cd content && zip -r ../mxd_content.zip . -i '*.md' '*.gmi' '*.adoc') cd $BASEDIR # Find all mxd_content.zip files in the current directory and its subdirectories find . -name "mxd_content.zip" | while read zip_file; do # Calculate the MD5 hash of the zip file md5sum "$zip_file" | awk '{print $1}' > "${zip_file%.zip}.md5.txt" echo "MD5 hash saved for: $zip_file" done