Added missing updates to ADMIN_update_server_ip.pl, issue #1109

git-svn-id: svn://192.168.202.10@3046 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2018-09-29 00:15:01 +00:00
parent f6e3675013
commit fee165c44b
+24 -3
View File
@@ -6,7 +6,7 @@
# astguiclient.conf file to reflect a change in IP address. The script will
# automatically default to the first eth address in the ifconfig output.
#
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGELOG
# 71205-2144 - Added display of extensions.conf example for call routing
@@ -15,6 +15,7 @@
# 90630-2256 - vicidial_process_triggers
# 100428-0943 - Added DB custom user/pass fields
# 150312-1000 - Added ExpectedDBSchema
# 180928-1958 - Added update of report_server, active_twin_server_ip and active_voicemail_server, issue #1109
#
# default path to astguiclient configuration file:
@@ -396,11 +397,26 @@ use DBI;
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
or die "Couldn't connect to database: " . DBI->errstr;
print " Updating servers table...\n";
print " Updating servers table: server_ip...\n";
$stmtA = "UPDATE servers SET server_ip='$VARserver_ip' where server_ip='$VARold_server_ip';";
$affected_rows = $dbhA->do($stmtA);
if ($DB) {print " |$affected_rows|$stmtA|\n";}
print " Updating servers table: active_twin_server_ip...\n";
$stmtA = "UPDATE servers SET active_twin_server_ip='$VARserver_ip' where active_twin_server_ip='$VARold_server_ip';";
$affected_rows = $dbhA->do($stmtA);
if ($DB) {print " |$affected_rows|$stmtA|\n";}
print " Updating system_settings table: active_voicemail_server...\n";
$stmtA = "UPDATE system_settings SET active_voicemail_server='$VARserver_ip' where active_voicemail_server='$VARold_server_ip';";
$affected_rows = $dbhA->do($stmtA);
if ($DB) {print " |$affected_rows|$stmtA|\n";}
print " Updating vicidial_automated_reports table: report_server...\n";
$stmtA = "UPDATE vicidial_automated_reports SET report_server='$VARserver_ip' where report_server='$VARold_server_ip';";
$affected_rows = $dbhA->do($stmtA);
if ($DB) {print " |$affected_rows|$stmtA|\n";}
print " Updating phones table...\n";
$stmtA = "UPDATE phones SET server_ip='$VARserver_ip' where server_ip='$VARold_server_ip';";
$affected_rows = $dbhA->do($stmtA);
@@ -451,11 +467,16 @@ $stmtA = "UPDATE vicidial_server_carriers SET server_ip='$VARserver_ip' where se
$affected_rows = $dbhA->do($stmtA);
if ($DB) {print " |$affected_rows|$stmtA|\n";}
print " Updating vicidial_inbound_dids table...\n";
print " Updating vicidial_inbound_dids table: server_ip...\n";
$stmtA = "UPDATE vicidial_inbound_dids SET server_ip='$VARserver_ip' where server_ip='$VARold_server_ip';";
$affected_rows = $dbhA->do($stmtA);
if ($DB) {print " |$affected_rows|$stmtA|\n";}
print " Updating vicidial_inbound_dids table: filter_server_ip...\n";
$stmtA = "UPDATE vicidial_inbound_dids SET filter_server_ip='$VARserver_ip' where filter_server_ip='$VARold_server_ip';";
$affected_rows = $dbhA->do($stmtA);
if ($DB) {print " |$affected_rows|$stmtA|\n";}
print " Updating vicidial_process_triggers table...\n";
$stmtA = "UPDATE vicidial_process_triggers SET server_ip='$VARserver_ip' where server_ip='$VARold_server_ip';";
$affected_rows = $dbhA->do($stmtA);