summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/LinHES-system/bin/mythrestore
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/LinHES-system/bin/mythrestore')
-rwxr-xr-xabs/core-testing/LinHES-system/bin/mythrestore22
1 files changed, 11 insertions, 11 deletions
diff --git a/abs/core-testing/LinHES-system/bin/mythrestore b/abs/core-testing/LinHES-system/bin/mythrestore
index c13d357..7fce371 100755
--- a/abs/core-testing/LinHES-system/bin/mythrestore
+++ b/abs/core-testing/LinHES-system/bin/mythrestore
@@ -1,10 +1,7 @@
#!/bin/bash
-# Let's prevent mythshutdown from shutting down the system.
-/usr/bin/mythshutdown --lock
-
#----------------------------------------------------------------------------
-. $LinHES_ROOT/bin/backupcommon || {
+. /usr/LH/bin/backupcommon || {
echo 1>&2 "Can not load common settings!"
exit 1
}
@@ -18,7 +15,7 @@ do_file_updates() { # A function because we need to do this in two places
do_db_updates() {
# We need to redo this since we just restored the old settings...
- /usr/bin/mythshutdown --lock
+ lock_myth
# This is gross, but makes sure that the lock count has a sane value...
mysql_cmd "update settings set data = '1' where value = 'MythShutdownLock'"
@@ -37,11 +34,14 @@ do_db_updates() {
mysql_cmd "drop table mythweb_sessions" >/dev/null 2>&1
}
+# Let's prevent mythshutdown from shutting down the system.
+lock_myth
+
# Play a sound to let you know I'm starting.
play_sound restore.wav
# Doing this while the backend is active could be BAD.
-/etc/init.d/mythtv-backend stop
+stop_mythbackend
# If the standard backup file exists we try to restore the files based
# on our restore list.
@@ -49,8 +49,8 @@ if compression=$(compression_type "$BACKUP_TAR") ; then
echo "Starting the restore of files..."
cd /
expand -c $BACKUP_TAR$compression |
- /bin/tar xpvf - $RESTORE_LIST $EXCLUSION 2>&1 |
- /bin/sed -e '/Error exit delayed from previous errors/d'
+ $TAR xpvf - $RESTORE_LIST $EXCLUSION 2>&1 |
+ $SED -e '/Error exit delayed from previous errors/d'
echo "Completed the restore of files."
fi
@@ -58,9 +58,9 @@ fi
if compression=$(compression_type "$BACKUP_SQL") ; then
echo "Starting the DB restore, this can take a while..."
echo "Clearing out the existing skeleton..."
- mysql_stdin < $DROP_SQL
+ #mysql_stdin < $DROP_SQL
echo "Recreating the db..."
- /usr/bin/mysqladmin -u root create $DATABASE
+ $MYSQLADMIN -u root create $DATABASE
echo "Restoring the data (long)..."
expand -c $BACKUP_SQL$compression | mysql_stdin
echo "Doing any needed db updates..."
@@ -87,6 +87,6 @@ do_db_updates
do_file_updates
# Now it's more or less safe to restart the backend.
-/etc/init.d/mythtv-backend stop ; /etc/init.d/mythtv-backend start
+start_mythbackend
exit $STATUS