From dfd71a19b63b0784bff6ac79ccdf368650ec72ad Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 7 Dec 2022 16:41:59 -0500
Subject: linhes-templates: add permissions.sql

---
 linhes/linhes-templates/PKGBUILD                     | 4 ++--
 linhes/linhes-templates/createTemplateSource.sh      | 4 ----
 linhes/linhes-templates/mp_preflight                 | 3 +++
 linhes/linhes-templates/templates/db/permissions.sql | 9 +++++++++
 4 files changed, 14 insertions(+), 6 deletions(-)
 delete mode 100755 linhes/linhes-templates/createTemplateSource.sh
 create mode 100755 linhes/linhes-templates/mp_preflight
 create mode 100644 linhes/linhes-templates/templates/db/permissions.sql

diff --git a/linhes/linhes-templates/PKGBUILD b/linhes/linhes-templates/PKGBUILD
index 6e93ca8..dc3af34 100644
--- a/linhes/linhes-templates/PKGBUILD
+++ b/linhes/linhes-templates/PKGBUILD
@@ -1,13 +1,13 @@
 pkgname=linhes-templates
 pkgver=9.0.0
-pkgrel=5
+pkgrel=7
 conflicts=()
 pkgdesc="Templates used for LinHES system configuration"
 depends=()
 makedepends=()
 arch=('x86_64')
 source=(templates.tar.gz)
-sha256sums=('6d959c2c25d860b7e74d493900fa0de412975ab5652317dd442388db6ee97f83')
+sha256sums=('08b953c8a1f90d4a7e94392d612b168c9d7eb98fb56d8b4ac5d614793aac16ef')
 
 package() {
     MVDIR=$pkgdir/usr/share/linhes
diff --git a/linhes/linhes-templates/createTemplateSource.sh b/linhes/linhes-templates/createTemplateSource.sh
deleted file mode 100755
index b18fe01..0000000
--- a/linhes/linhes-templates/createTemplateSource.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/bash
-#run this before building the PKGBUILD
-
-tar -czvf templates.tar.gz ./templates
diff --git a/linhes/linhes-templates/mp_preflight b/linhes/linhes-templates/mp_preflight
new file mode 100755
index 0000000..2017567
--- /dev/null
+++ b/linhes/linhes-templates/mp_preflight
@@ -0,0 +1,3 @@
+#!/usr/bin/bash
+echo "    Starting mp_preflight"
+tar -czvf templates.tar.gz ./templates
diff --git a/linhes/linhes-templates/templates/db/permissions.sql b/linhes/linhes-templates/templates/db/permissions.sql
new file mode 100644
index 0000000..108a1ab
--- /dev/null
+++ b/linhes/linhes-templates/templates/db/permissions.sql
@@ -0,0 +1,9 @@
+CREATE DATABASE IF NOT EXISTS mythconverg;
+GRANT ALL ON mythconverg.* TO 'mythtv'@localhost IDENTIFIED BY 'mythtv';
+GRANT ALL ON mythconverg.* TO 'mythtv'@'%' IDENTIFIED BY 'mythtv';
+GRANT FILE ON *.* TO 'mythtv'@"%";
+FLUSH PRIVILEGES;
+GRANT CREATE TEMPORARY TABLES ON mythconverg.* TO 'mythtv'@localhost IDENTIFIED BY 'mythtv';
+GRANT CREATE TEMPORARY TABLES ON mythconverg.* TO 'mythtv'@'%' IDENTIFIED BY 'mythtv';
+FLUSH PRIVILEGES;
+ALTER DATABASE mythconverg DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
-- 
cgit v0.12

