+### Database operations.
+
+INDEXDB=@pkglocalstatedir@/index.db
+
+insert_index () {
+ host=$1 fs=$2 date=$3 vol=$4
+
+ if [ -f "$INDEXDB" ]; then
+ sqlite3 "$INDEXDB" <<EOF
+INSERT INTO idx (host, fs, date, vol)
+ VALUES ('$host', '$fs', '$date', '$vol');
+EOF
+ fi
+}
+
+delete_index () {
+ host=$1 fs=$2 date=$3
+
+ if [ -f "$INDEXDB" ]; then
+ sqlite3 "$INDEXDB" <<EOF
+DELETE FROM idx WHERE
+ host = '$host' AND fs = '$fs' AND $date = '$date';
+EOF
+ fi
+}
+
+###--------------------------------------------------------------------------