mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-18 19:10:30 +08:00
node: Populate refs db on startup
If the refs database is empty, populate it on startup. Also includes a script to clear it.
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
DB="$(rad path)/node/node.db"
|
||||
|
||||
if command -v sqlite3 >/dev/null 2>&1; then
|
||||
if [ -f "$DB" ]; then
|
||||
echo -n "Clearing 'refs' table from $DB.. "
|
||||
sqlite3 $DB "DELETE FROM refs;"
|
||||
echo "done."
|
||||
else
|
||||
echo "fatal: database file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "fatal: sqlite3 is not installed"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user