diff options
Diffstat (limited to 'abs/core-testing/LinHES-config/restore_km_db_chroot.sh')
-rw-r--r-- | abs/core-testing/LinHES-config/restore_km_db_chroot.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/abs/core-testing/LinHES-config/restore_km_db_chroot.sh b/abs/core-testing/LinHES-config/restore_km_db_chroot.sh index 35e8fbd..17ad113 100644 --- a/abs/core-testing/LinHES-config/restore_km_db_chroot.sh +++ b/abs/core-testing/LinHES-config/restore_km_db_chroot.sh @@ -29,12 +29,19 @@ if [ $SystemType = "Master_backend" -o $SystemType = "Standalone" ] #load database pacman --noconfirm -R mythdb-initial pacman --noconfirm -S mythdb-initial - echo "restoring old database" - gunzip -c /myth/backup/mythconverg.sql.gz > /myth/backup/mythconverg.sql - mysql mythconverg < /myth/backup/mythconverg.sql + + if [ -f /myth/backup/mythconverg.sql.gz ] + then + echo "restoring old database" + gunzip -c /myth/backup/mythconverg.sql.gz > /myth/backup/mythconverg.sql + mysql mythconverg < /myth/backup/mythconverg.sql + + else + echo "Could not restore old database, mythconverg.sql is missing." + touch /tmp/.upgrade_db_failed + fi if [ -d /data/srv/mysql/mythconverg ] - #if [ -d /var/lib/mysql/mythconverg ] then status=0 fi |