diff --git a/helper/sync-db b/helper/sync-db index 04f5df12..327310c2 100755 --- a/helper/sync-db +++ b/helper/sync-db @@ -61,6 +61,9 @@ exit 1 unless(sync_extra_sockets($dbh, exit 1 unless(sync_rtp_interfaces($dbh, { map {$_ => $_} @{$config->{rtp_interfaces}} } )); +exit 1 unless(sync_general_timezone($dbh, + $config->{general}->{timezone})); + $dbh->disconnect; exit 0; @@ -135,4 +138,30 @@ sub sync_rtp_interfaces { return generic_enum_sync(@_, 'rtp_interface'); } +## general.timezone handling: ############################## +sub sync_general_timezone { + my $dbh = shift; + my $tz = shift; + + unless ($tz) { + print "Error: general.timezone value is not set\n"; + return; + } + + my $pe = $dbh->{PrintError}; + $dbh->{PrintError} = 0; + $dbh->do(<{PrintError} = $pe; + if ($DBI::err) { + print "Error: Could not insert into ngcp.timezone: $DBI::errstr\n"; + return; + } + + return 1; +} + + ## END OF FILE #################################################################