summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/mythtv/stable/mythdb-initial/mythdb.install
diff options
context:
space:
mode:
authorCecil Hugh Watson <knoppmyth@gmail.com>2009-02-20 23:40:57 (GMT)
committerCecil Hugh Watson <knoppmyth@gmail.com>2009-02-20 23:40:57 (GMT)
commit2acabc04e7b5589acc5d57e382e859771e636edf (patch)
tree595da672ed00723eca717a3012627dcf05959ab6 /abs/core-testing/mythtv/stable/mythdb-initial/mythdb.install
parentf70613cf1cb7bf8acd26d8e04228c3e0aaebb4b0 (diff)
parent1e5682bd24f2663d0f817d5254849809af30942e (diff)
downloadlinhes_pkgbuild-2acabc04e7b5589acc5d57e382e859771e636edf.zip
linhes_pkgbuild-2acabc04e7b5589acc5d57e382e859771e636edf.tar.gz
linhes_pkgbuild-2acabc04e7b5589acc5d57e382e859771e636edf.tar.bz2
Merge branch 'HEAD' of ssh://cesman@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Diffstat (limited to 'abs/core-testing/mythtv/stable/mythdb-initial/mythdb.install')
-rwxr-xr-xabs/core-testing/mythtv/stable/mythdb-initial/mythdb.install36
1 files changed, 22 insertions, 14 deletions
diff --git a/abs/core-testing/mythtv/stable/mythdb-initial/mythdb.install b/abs/core-testing/mythtv/stable/mythdb-initial/mythdb.install
index 7833aa4..4834c69 100755
--- a/abs/core-testing/mythtv/stable/mythdb-initial/mythdb.install
+++ b/abs/core-testing/mythtv/stable/mythdb-initial/mythdb.install
@@ -1,23 +1,31 @@
mydate=`date +%m-%d-%y`
HOST=`hostname`
post_install() {
- echo archiving the old database
- mysqldump mythconverg > /data/database/mythconverg.${mydate}.sql
+#echo backup the old database
+ mysqldump mythconverg >/data/database/mythconverg.${mydate}.sql
+# echo dropping the old database
+ mysql -u root -e 'drop database mythconverg;'
+ mysql -u root -e 'create database mythconverg;'
+ echo installing the default database
+ if [ $HOST = 'larch5' ]
+ then
+ cp /data/database/mc.sql.initial /data/database/mc.sql.fixed
+ cp /data/database/permissions.sql /data/database/permissions.sql.fixed
+ else
+ sed -e "s/larch5/$HOST/g" /data/database/mc.sql.initial > /data/database/mc.sql.fixed
+ sed -e "s/larch5/$HOST/g" /data/database/permissions.sql > /data/database/permissions.sql.fixed
- echo installing the baseline database
- sed -e "s/MythTVhost/$HOST/g" /data/database/mc.sql.initial > /data/database/mc.sql.fixed
- sed -e "s/MythTVhost/$HOST/g" /data/database/permissions.sql > /data/database/permissions.sql.fixed
- mysql < /data/database/mc.sql.fixed 2>/dev/null
- mysql < /data/database/permissions.sql.fixed 2>/dev/null
- # Keep the baseline SQL file around because it's useful to learn what changes users made
- # to their Tweaker-customized defaults.
- #rm /data/database/mc.sql.initial
-}
+ fi
+
+ mysql mythconverg < /data/database/mc.sql.fixed 2>/dev/null
+ mysql < /data/database/permissions.sql.fixed 2>/dev/null
+ rm /data/database/mc.sql.initial
+}
post_upgrade() {
- echo "nothing to do"
+ echo "nothing to do"
}
-op=$1
-shift
+op=$1
+shift
$op $*