Added servers option to auto-restart Asterisk, turned off by default
Fixed several missing DB finish functions on perl scripts git-svn-id: svn://192.168.202.10@2043 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# start_asterisk_boot.pl version 2.0.5
|
||||
# start_asterisk_boot.pl version 2.8
|
||||
#
|
||||
# This script is designed to start Asterisk in the proper way for Vicidial to
|
||||
# operate as intended
|
||||
#
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -15,8 +15,10 @@
|
||||
# 90325-2238 - mattf - Rewrote launching of Asterisk, removed command files
|
||||
# 90506-1443 - mikec - Added the T option to the asterisk command. This enables timestamping.
|
||||
# 91210-1500 - mattf - Added datetimestamp to astshell screen
|
||||
# 131022-1659 - mattf - Added CLI help display
|
||||
#
|
||||
|
||||
$build = '131022-1659';
|
||||
# default path to astguiclient configuration file:
|
||||
$PATHconf = '/etc/astguiclient.conf';
|
||||
|
||||
@@ -56,6 +58,46 @@ if ($min < 10) {$min = "0$min";}
|
||||
if ($sec < 10) {$sec = "0$sec";}
|
||||
$launch_date = "$year$mon$mday$hour$min$sec";
|
||||
|
||||
$force_logging=0;
|
||||
### begin parsing CLI run-time options ###
|
||||
if (length($ARGV[0])>1)
|
||||
{
|
||||
$i=0;
|
||||
$allow_inactive_list_leads=0;
|
||||
while ($#ARGV >= $i)
|
||||
{
|
||||
$args = "$args $ARGV[$i]";
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($args =~ /--help/i)
|
||||
{
|
||||
print "allowed run time options(must stay in this order):\n";
|
||||
print " [--help] = this screen\n";
|
||||
print " [--version] = print version of this script, then exit\n";
|
||||
print " [--force-logging] = forces extra logging of asterisk even if disabled in settings\n";
|
||||
print "\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($args =~ /--version/i)
|
||||
{
|
||||
print "version: $build\n";
|
||||
exit;
|
||||
}
|
||||
if ($args =~ /--force-logging/i)
|
||||
{
|
||||
$force_logging=1;
|
||||
print "extra logging forced: $force_logging\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# print "no command line options set\n";
|
||||
}
|
||||
|
||||
`PERL5LIB="$PATHhome/libs"; export PERL5LIB`;
|
||||
|
||||
use DBI;
|
||||
@@ -79,7 +121,7 @@ $sthA->finish();
|
||||
|
||||
`ulimit -n 65536`;
|
||||
|
||||
if ($SYSLOG)
|
||||
if ( ($SYSLOG) || ($force_logging > 0) )
|
||||
{
|
||||
`/usr/bin/screen -d -m -S astershell$launch_date /usr/bin/screen -S astshell$launch_date`;
|
||||
print "started screen\n";
|
||||
|
||||
Reference in New Issue
Block a user