summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/system-restore9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/system-restore b/scripts/system-restore
index a044d2d..d65460e 100755
--- a/scripts/system-restore
+++ b/scripts/system-restore
@@ -101,8 +101,17 @@ else
fi
if [ $RET -eq 0 -a $RES_OPENSLX -eq 1 ]; then
echo "--- Importing system configuration"
+ # Backup and restore minilinux metadata -- doesn't make sense to import this from the backup
+ mtmp="$( mktemp )"
+ mysqldump --defaults-extra-file=/etc/mysql/debian.cnf --add-locks --default-character-set=utf8 openslx minilinux_source minilinux_branch minilinux_version > "${mtmp}" 2> /dev/null
+ mlret=$?
mysql --defaults-extra-file=/etc/mysql/debian.cnf --default-character-set=utf8 < openslx.sql
RET=$?
+ if [ "$mlret" = 0 ]; then
+ mysql --defaults-extra-file=/etc/mysql/debian.cnf --default-character-set=utf8 --database=openslx -e "DROP TABLE IF EXISTS minilinux_version, minilinux_branch, minilinux_source"
+ mysql --defaults-extra-file=/etc/mysql/debian.cnf --default-character-set=utf8 --database=openslx < "${mtmp}"
+ fi
+ rm -f -- "$mtmp"
fi
fi