From c4c02533e77d0ba4a6c2e49d5dcb076121c6d36d Mon Sep 17 00:00:00 2001 From: vilmibm Date: Mon, 6 Mar 2023 03:07:35 +0000 Subject: [PATCH] town db scripting --- scripts/reset_town_db.sh | 12 ++++++++++++ sql/{create_towndb.sql => create_town_db.sql} | 0 2 files changed, 12 insertions(+) create mode 100755 scripts/reset_town_db.sh rename sql/{create_towndb.sql => create_town_db.sql} (100%) diff --git a/scripts/reset_town_db.sh b/scripts/reset_town_db.sh new file mode 100755 index 0000000..c02cb9c --- /dev/null +++ b/scripts/reset_town_db.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +dbpath="/town/var/town.db" +srcpath="/town/src/town" + +rm -f "$dbpath" +sqlite3 < "${srcpath}/sql/create_town_db.sql" "$dbpath" +chown root:admin "$dbpath" +chmod o-r "$dbpath" +chmod g+w "$dbpath" diff --git a/sql/create_towndb.sql b/sql/create_town_db.sql similarity index 100% rename from sql/create_towndb.sql rename to sql/create_town_db.sql