Skip to content

Instantly share code, notes, and snippets.

Created March 5, 2017 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/13ea405e2d4bc214c959a51729c81f4b to your computer and use it in GitHub Desktop.
Save anonymous/13ea405e2d4bc214c959a51729c81f4b to your computer and use it in GitHub Desktop.
#! /bin/sh
DATABASE_LOCATION="$HOME/Library/Application Support/BathyScaphe/"
DB_NAME="BathyScaphe.db"
cd "$DATABASE_LOCATION"
echo '.dump' | sqlite3 "$DB_NAME" | sqlite3 repaired_"$DB_NAME"
mv -n "$DB_NAME" corrupt_"$DB_NAME"
mv -n repaired_"$DB_NAME" "$DB_NAME"
cd - > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment