#!/bin/bash # Check if mkvpropedit is installed if ! command -v mkvpropedit &> /dev/null; then echo "Error: mkvpropedit is not installed. Install mkvtoolnix package." exit 1 fi # Check if a directory is provided if [ "$#" -ne 1 ]; then echo "Usage: $0 " exit 1 fi DIRECTORY="$1" # Check if directory exists if [ ! -d "$DIRECTORY" ]; then echo "Error: Directory '$DIRECTORY' not found." exit 1 fi # Find and process all .mkv files in the directory find "$DIRECTORY" -type f -name "*.mkv" | while read -r MKV_FILE; do echo "Processing: $MKV_FILE" mkvpropedit "$MKV_FILE" --attachment-mime-type "application/x-font-otf" --update-attachment "mime-type:application/vnd.ms-opentype" mkvpropedit "$MKV_FILE" --attachment-mime-type "application/x-font-otf" --update-attachment "mime-type:font/otf" mkvpropedit "$MKV_FILE" --attachment-mime-type "application/x-font-ttf" --update-attachment "mime-type:font/ttf" done echo "All applicable MKV files updated successfully."