Skip to content

Instantly share code, notes, and snippets.

@swizzlevixen
Created February 7, 2025 22:59
Show Gist options
  • Select an option

  • Save swizzlevixen/62fa0541b719da0fe8130ac129f60997 to your computer and use it in GitHub Desktop.

Select an option

Save swizzlevixen/62fa0541b719da0fe8130ac129f60997 to your computer and use it in GitHub Desktop.
MakeMKV macOS update keydb.cfg from FindVUK Online Database
#!/bin/zsh
# This script downloads the latest copy of the FindVUK Online Database,
# unzips, and moves it to the logged in user's MakeMKV data directory
# NOTE: This script is designed for use on macOS, with the default
# location for the MakeMKV data directory. If you have changed the
# location in Preferences > General, you will need to edit the line
# that moves the file, near the end of the script.
# Config variables
downloadUrl="http://fvonline-db.bplaced.net/fv_download.php?lang=eng"
zipName="keydb_eng.zip"
filename="keydb.cfg"
# Download
echo "Downloading latest FindVUK Online Database..."
curl -Lo "/tmp/$zipName" "$downloadUrl"
# Check for the file name (case insensitive) inside the zip
if unzip -l /tmp/$zipName | grep -qiF "$filename"; then
# unzip file to /tmp, without any surrounding folder structure
echo "Unzipping..."
unzip -j /tmp/$zipName -d /tmp
else
echo "ERROR: $filename not found inside $zipName"
exit 1
fi
# Confirm the file exists
if [ -f "/tmp/$filename" ]; then
# move file to MakeMKV data directory
echo "Moving to MakeMKV data directory..."
loggedInUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
mv /tmp/$filename /Users/$loggedInUser/Library/MakeMKV/$filename
rm /tmp/$zipName
else
echo "ERROR: File not found; possible error unzipping."
exit 1
fi
echo "Done."
exit 0
@or1onsli
Copy link
Copy Markdown

Is it just me or the resource is offline at the moment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment