diff options
author | James Meyer <james.meyer@operamail.com> | 2008-12-14 16:25:54 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2008-12-14 16:25:54 (GMT) |
commit | 6526e29a9d5425c0d294f7a376956b8440cb5631 (patch) | |
tree | bdc2ea49837dceb377dda0c3e98c7e4686cc5f97 /abs/core-testing/LinHES-config/install_proxy.sh | |
parent | 15f49f7b2cb3016c36b981641703b7a13951f28d (diff) | |
download | linhes_pkgbuild-6526e29a9d5425c0d294f7a376956b8440cb5631.zip linhes_pkgbuild-6526e29a9d5425c0d294f7a376956b8440cb5631.tar.gz linhes_pkgbuild-6526e29a9d5425c0d294f7a376956b8440cb5631.tar.bz2 |
if /myth/backup/mythconverg.sql is not present check for the file in /root/backup/
closes FS#60
Diffstat (limited to 'abs/core-testing/LinHES-config/install_proxy.sh')
-rwxr-xr-x | abs/core-testing/LinHES-config/install_proxy.sh | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/abs/core-testing/LinHES-config/install_proxy.sh b/abs/core-testing/LinHES-config/install_proxy.sh index 92b90dc..f251c70 100755 --- a/abs/core-testing/LinHES-config/install_proxy.sh +++ b/abs/core-testing/LinHES-config/install_proxy.sh @@ -14,6 +14,7 @@ run=$MV_ROOT/bin/install_functions.sh . /etc/systemconfig 2>/dev/null . $MV_ROOT/bin/networkconfig.sh CMDLINE=$(cat /proc/cmdline) +BACKUPFILE="/myth/backup/mythconverg.sql.gz" #TEMPNET="Hostip"$default_interface #eval MYTHIP=\$${TEMPNET} @@ -53,11 +54,13 @@ function apply_new_auth () { function backup_sql_check { - - if [ -f $mountpoint/myth/backup/mythconverg.sql.gz ] + if [ -f ${mountpoint}${BACKUPFILE} ] then + + echo "found ${mountpoint}${BACKUPFILE} " return 0 else + echo "did not find ${mountpoint}${BACKUPFILE} " return 1 fi } @@ -66,6 +69,14 @@ function upgrade_mount_search { MYTH_P=`cat /tmp/etc/fstab |grep /myth| awk ' {print $1 '} ` umount $mountpoint/myth mount $MYTH_P $mountpoint/myth + backup_sql_check + if [ $? = 1 ] + then + mkdir -p /new_boot/root/backup + cp -f /tmp/mythconverg.sql.gz /new_boot/root/backup/mythconverg.sql.gz + BACKUPFILE="/root/backup/mythconverg.sql.gz" + echo "setting BACKUPFILE to $BACKUPFILE" + fi return 0 } @@ -237,7 +248,8 @@ function upgrade () { cp /etc/mtab "$mountpoint"/etc/mtab cp -f /etc/systemconfig "$mountpoint"/etc #make sure mythconverg.sql.gz is present - if [ ! backup_sql_check ] + backup_sql_check + if [ $? = 1 ] then upgrade_mount_search fi @@ -284,12 +296,12 @@ function upgrade () { chroot "$mountpoint" "$MV_ROOT/bin/install_db_chroot.sh" > /tmp/chrootdb.out else #proceed as normal - if [ -f /new_boot/myth/backup/mythconverg.sql.gz ] + if [ -f "$mountpoint"/$BACKUPFILE ] then echo "--------------------------------" echo "Restoring database" echo "--------------------------------" - chroot "$mountpoint" "$MV_ROOT/bin/restore_km_db_chroot.sh" > /tmp/chrootdb_km.out + chroot "$mountpoint" "$MV_ROOT/bin/restore_km_db_chroot.sh" "$BACKUPFILE" > /tmp/chrootdb_km.out else echo "--------------------------------" echo "Couldn't find backup file, installing new database" @@ -385,6 +397,7 @@ echo "-----------------------------------------------------------------------3-- if [ $? = 1 ] then $run mount_it $disk + [ -e "/new_boot/root/backup/mythconverg.sql.gz" ] && cp /new_boot/root/backup/mythconverg.sql.gz /tmp if [ -f /new_boot/etc/systemconfig ] then ###########ADD templates |