Skip to content

Commit 423b1d7

Browse files
committed
Added a filesize check for existing_db.sql in updater to stop update process if the expoerted database dump is smaller then about 60 KB.
1 parent b3b8495 commit 423b1d7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

install/update.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@
149149
system("mysqldump -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -c -t --add-drop-table --create-options --quick --result-file=existing_db.sql ".$conf['mysql']['database']);
150150
}
151151

152+
if(filesize('existing_db.sql') < 60000) die('Possible problem with dumping the database. We will stop here. Please check the file existing_db.sql');
153+
152154
// create a backup copy of the ispconfig database in the root folder
153155
$backup_db_name = '/root/ispconfig_db_backup_'.@date('Y-m-d_h-i').'.sql';
154156
copy('existing_db.sql',$backup_db_name);

0 commit comments

Comments
 (0)