isbn-sort/init.sh
2024-04-19 11:30:55 +02:00

14 lines
253 B
Bash
Executable File

#!/bin/bash
DATABASE=books.sqlite
mkdir -p data
ls data | grep "$DATABASE" > /dev/null
if [ $? -eq 0 ]; then
echo "Created data/books-backup.sqlite"
mv "data/$DATABASE" data/books-backup.sqlite
fi
sqlite3 "data/$DATABASE" < isbn_sort/schema.sql