Skip to content

Commit c086645

Browse files
alextsphery
authored andcommitted
Fix restore script host name change with generic names.
Fix the restore script's --change_hostname functionality to work properly even with generic host names, like "myth" or "a". Thanks to Alex Tomlins for the patch. Refs #9482.
1 parent e4f6977 commit c086645

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mythtv/programs/scripts/database/mythconverg_restore.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# Script info
1515
$NAME = 'MythTV Database Restore Script';
16-
$VERSION = '1.0.16';
16+
$VERSION = '1.0.17';
1717

1818
# Some variables we'll use here
1919
our ($username, $homedir, $mythconfdir, $database_information_file);
@@ -1435,9 +1435,9 @@
14351435
$query = "UPDATE $table_name SET value = REPLACE(value, ?, ?)".
14361436
" WHERE value LIKE ?";
14371437
$sth_update = $dbh->prepare($query);
1438-
$sth_update->bind_param(1, $old_hostname);
1439-
$sth_update->bind_param(2, $new_hostname);
1440-
$sth_update->bind_param(3, '%'.$old_hostname.'%');
1438+
$sth_update->bind_param(1, 'SGweightPerDir:'.$old_hostname.':');
1439+
$sth_update->bind_param(2, 'SGweightPerDir:'.$new_hostname.':');
1440+
$sth_update->bind_param(3, 'SGweightPerDir:'.$old_hostname.':%');
14411441
$result = $sth_update->execute;
14421442
if (!defined($result))
14431443
{

0 commit comments

Comments
 (0)