several minor fixes and changes mostly to bin scripts

Change back to development half-version number: 2.0.4.0-5

git-svn-id: svn://192.168.202.10@743 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2007-12-06 03:13:04 +00:00
parent f83b030d7e
commit ddd60f5546
10 changed files with 449 additions and 31 deletions
+33 -5
View File
@@ -1,16 +1,16 @@
#!/usr/bin/perl
# ADMIN_update_server_ip.pl
# ADMIN_update_server_ip.pl - updates IP address in DB and conf file
#
# This script is designed to update all database tables and the local
# 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) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
# CHANGELOG
# 71205-2144 - added display of extensions.conf example for call routing
#
############################################
# ADMIN_update_server_ip.pl - updates IP address in DB and conf file
#
# default path to astguiclient configuration file:
$PATHconf = '/etc/astguiclient.conf';
@@ -382,11 +382,39 @@ if ($DB) {print " |$affected_rows|$stmtA|\n";}
$dbhA->disconnect();
### format the new server_ip dialstring for example to use with extensions.conf
$S='*';
if( $VARserver_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ )
{
$a = leading_zero($1);
$b = leading_zero($2);
$c = leading_zero($3);
$d = leading_zero($4);
$VARremDIALstr = "$a$S$b$S$c$S$d";
}
print "\nSERVER IP ADDRESS CHANGE FOR VICIDIAL FINISHED!\n";
print "\nPlease remember to change your extensions.conf entries for the new IP address:\n";
print "exten => _$VARremDIALstr*8600XXX,1,Goto(default,${EXTEN:16},1)\n";
print "exten => _$VARremDIALstr*8600XXX*.,1,Goto(default,${EXTEN:16},1)\n";
print "exten => _$VARremDIALstr*78600XXX,1,Goto(default,${EXTEN:16},1)\n";
print "exten => _$VARremDIALstr*78600XXX*.,1,Goto(default,${EXTEN:16},1)\n";
print "exten => _8600XXX*.,1,AGI(agi-VDADfixCXFER.agi)\n";
print "exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi)\n";
$secy = time(); $secz = ($secy - $secX); $minz = ($secz/60); # calculate script runtime so far
print "\n - process runtime ($secz sec) ($minz minutes)\n";
exit;
sub leading_zero($)
{
$_ = $_[0];
s/^(\d)$/0$1/;
s/^(\d\d)$/0$1/;
return $_;
} # End of the leading_zero() routine.