looqs/delindex

22 řádky
363 B
Plaintext
Surový Normální zobrazení Historie

2018-01-03 09:40:13 +01:00
#!/bin/sh
TEMPFILE=$(mktemp)
2018-08-12 16:47:46 +02:00
DBFILE="$QSS_PATH"
2018-01-03 09:40:13 +01:00
function todelete()
{
echo "DELETE FROM file WHERE path = '$1';" >> /"$TEMPFILE"
}
echo "BEGIN TRANSACTION;" >> /"$TEMPFILE"
sqlite3 "$DBFILE" "SELECT path FROM file;"| while read line ; do
[ -e "$line" ] || todelete "$line"
done
echo "COMMIT TRANSACTION;" >> /"$TEMPFILE"
sqlite3 "$DBFILE" < /"$TEMPFILE"