diff options
Diffstat (limited to 'abs/core/mythdb-initial/mythdb.install')
-rwxr-xr-x | abs/core/mythdb-initial/mythdb.install | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/abs/core/mythdb-initial/mythdb.install b/abs/core/mythdb-initial/mythdb.install index be4e64f..1302d30 100755 --- a/abs/core/mythdb-initial/mythdb.install +++ b/abs/core/mythdb-initial/mythdb.install @@ -1,30 +1,28 @@ mydate=`date +%m-%d-%y` HOST=`hostname` post_install() { - mysqldump mythconverg >/data/database/mythconverg.${mydate}.sql - #load timezone info for mythtv .26 - mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql - mysql -u root -e 'drop database mythconverg;' + mysqldump mythconverg >/data/database/mythconverg.${mydate}.sql + #load timezone info for mythtv .26 + mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql + mysql -u root -e 'drop database mythconverg;' mysql -u root -e 'create database mythconverg;' - echo installing the default database - if [ $HOST = 'apheleia' ] - then - cp /data/database/mc.sql.initial /data/database/mc.sql.fixed - cp /data/database/permissions.sql /data/database/permissions.sql.fixed - cp /data/database/custom.sql /data/database/custom.sql.fixed - else - sed -e "s/apheleia/$HOST/g" /data/database/mc.sql.initial > /data/database/mc.sql.fixed - sed -e "s/apheleia/$HOST/g" /data/database/permissions.sql > /data/database/permissions.sql.fixed - sed -e "s/apheleia/$HOST/g" /data/database/custom.sql > /data/database/custom.sql.fixed - + echo installing the default database + if [ $HOST = 'apheleia' ] + then + cp /data/database/mc.sql.initial /data/database/mc.sql.fixed + cp /data/database/permissions.sql /data/database/permissions.sql.fixed + cp /data/database/custom.sql /data/database/custom.sql.fixed + else + sed -e "s/apheleia/$HOST/g" /data/database/mc.sql.initial > /data/database/mc.sql.fixed + sed -e "s/apheleia/$HOST/g" /data/database/permissions.sql > /data/database/permissions.sql.fixed + sed -e "s/apheleia/$HOST/g" /data/database/custom.sql > /data/database/custom.sql.fixed fi - MC="/data/database/mc.sql.fixed" - mysql mythconverg < $MC 2>/dev/null - mysql < /data/database/permissions.sql.fixed 2>/dev/null - mysql mythconverg < /data/database/custom.sql.fixed 2>/dev/null + mysql mythconverg < $MC 2>/dev/null + mysql < /data/database/permissions.sql.fixed 2>/dev/null + mysql mythconverg < /data/database/custom.sql.fixed 2>/dev/null # rm /data/database/mc.sql.initial # rm /data/database/custom.sql.fixed |