Created
January 10, 2025 10:46
-
-
Save luckylittle/b668184b132b028285eb00fb47b59f64 to your computer and use it in GitHub Desktop.
Simple process how to create INI file for each of your BluRay discs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Parameters | |
DISC_LABEL=$(isoinfo -d -i /dev/sr0 | grep 'Volume id: ' | sed 's|Volume id: ||') | |
MOUNT_POINT="/mnt/bluray" | |
CATALOG_FILE="/home/$USER/Temp/Catalogs/bdr_catalog.txt" | |
# Ensure the catalog file exists | |
touch $CATALOG_FILE | |
# Mount the Blu-ray disc | |
sudo mount /dev/sr0 $MOUNT_POINT | |
# Add the disc label to the catalog file | |
echo "[$DISC_LABEL]" >> $CATALOG_FILE | |
# Append the list of files from the disc to the catalog | |
find $MOUNT_POINT -type f | sed "s|^$MOUNT_POINT/||" >> $CATALOG_FILE | |
echo '---' >> $CATALOG_FILE | |
# Unmount the disc | |
sudo umount $MOUNT_POINT | |
# Completion message | |
echo "Catalog updated for $DISC_LABEL in $CATALOG_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment