install.pl created - not functional

git-svn-id: svn://192.168.202.10@30 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2006-07-08 01:44:53 +00:00
parent 3ab86b4dee
commit ccf6fa91e1
2 changed files with 281 additions and 1 deletions
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# install_server_files.pl
# build_translation_www_files.pl
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
+280
View File
@@ -0,0 +1,280 @@
#!/usr/bin/perl
# install.pl
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
############################################
# install.pl - puts server files in the right places and creates conf file
#
# modify the variables below to customize for your system.
#
# default path to home directory:
$home = '/usr/share/astguiclient';
# default path to agi-bin directory:
$agibin = '/var/lib/asterisk/agi-bin';
# default path to web root directory:
#$webroot = '/var/www/html';
#$webroot = '/home/www/htdocs';
$webroot = '/usr/local/apache2/htdocs';
# default path to asterisk sounds directory:
$sounds = '/var/lib/asterisk/sounds';
# default path to asterisk recordings directory:
$monitor = '/var/spool/asterisk';
############################################
$secX = time();
# constants
$DB=1; # Debug flag, set to 0 for no debug messages, lots of output
$US='_';
$MT[0]='';
$language_admin_file = 'language_admin.txt';
$language_file = 'language.txt';
### begin parsing run-time options ###
if (length($ARGV[0])>1)
{
$i=0;
while ($#ARGV >= $i)
{
$args = "$args $ARGV[$i]";
$i++;
}
if ($args =~ /--help/i)
{
print "allowed run time options:\n [-t] = test\n [-debug] = verbose debug messages\n[--admin-only] = only translate admin pages\n[--client-only] = only translate client pages\n[--without-en] = only translate non-english\n[--language=] = which language to build, 2 letter code, defaults to es-spanish\n\n";
exit;
}
else
{
if ($args =~ /-debug/i)
{
$DB=1; # Debug flag
}
if ($args =~ /--language/i)
{
$LANG=1;
print "\n----- LANGUAGE WEB SCRIPT ONLY BUILD -----\n\n";
}
if ($args =~ /--language=/i)
{
@data_in = split(/--language=/,$args);
$CLIlanguage = $data_in[1];
}
else
{$CLIlanguage = 'es';} # default to build all languages
if ($args =~ /-admin-only/i)
{
$admin_only=1; # Admin flag
print "\n----- ADMIN PAGES ONLY BUILD -----\n\n";
}
if ($args =~ /-client-only/i)
{
$client_only=1; # Client flag
print "\n----- CLIENT PAGES ONLY BUILD -----\n\n";
}
if ($args =~ /-without-en/i)
{
print "\n----- NON-ENGLISH ONLY BUILD -----\n\n";
$without_en=1;
}
if ($args =~ /-t/i)
{
$TEST=1;
$T=1;
}
}
}
else
{
# print "no command line options set\n";
}
### end parsing run-time options ###
if ($LANG)
{
if ( (!$admin_only) && (!$client_only) )
{$admin_only=1; $client_only=1;}
if ($admin_only==1)
{
print "\n----- LANGUAGE BUILD: $CLIlanguage -----\n\n";
$LANG_FILE_ADMIN = "./translations/$CLIlanguage$US$language_admin_file";
open(lang, "$LANG_FILE_ADMIN") || die "can't open $LANG_FILE_ADMIN: $!\n";
@lang = <lang>;
close(lang);
&translate_pages;
}
@lang=@MT;
@LANGUAGES=@MT;
@FILES=@MT;
@TRANSLATIONS=@MT;
@TRANSLATIONS_RAW=@MT;
if ($client_only==1)
{
$LANG_FILE = "./translations/$CLIlanguage$US$language_file";
open(lang, "$LANG_FILE") || die "can't open $LANG_FILE: $!\n";
@lang = <lang>;
close(lang);
&translate_pages;
}
}
else
{
print "INSTALLING SERVER SIDE COMPONENTS...\n";
print "Creating cron/LOGS directory...\n";
`mkdir $home/LOGS/`;
print "setting LOGS directory to executable...\n";
`chmod 0766 $home/LOGS`;
print "Creating $home/VICIDIAL/LEADS_IN/DONE directory...\n";
`mkdir $home/VICIDIAL`;
`mkdir $home/VICIDIAL/LEADS_IN`;
`mkdir $home/VICIDIAL/LEADS_IN/DONE`;
`chmod -R 0766 $home/VICIDIAL`;
print "Creating $monitor directories...\n";
`mkdir $monitor/monitor`;
`mkdir $monitor/monitor/ORIG`;
`mkdir $monitor/monitor/DONE`;
`chmod -R 0766 $monitor/monitor`;
print "Copying cron scripts...\n";
`cp -f ./ADMIN_adjust_GMTnow_on_leads.pl $home/`;
`cp -f ./ADMIN_area_code_populate.pl $home/`;
`cp -f ./ADMIN_keepalive_AST_send_listen.pl $home/`;
`cp -f ./ADMIN_keepalive_send_listen.at $home/`;
`cp -f ./ADMIN_keepalive_AST_update.pl $home/`;
`cp -f ./ADMIN_keepalive_AST_VDautodial.pl $home/`;
`cp -f ./ADMIN_keepalive_AST_VDremote_agents.pl $home/`;
`cp -f ./ADMIN_restart_roll_logs.pl $home/`;
`cp -f ./AST_agent_week.pl $home/`;
`cp -f ./AST_cleanup_agent_log.pl $home/`;
`cp -f ./AST_conf_update.pl $home/`;
`cp -f ./AST_CRON_mix_recordings.pl $home/`;
`cp -f ./AST_CRON_mix_recordings_BASIC.pl $home/`;
`cp -f ./AST_CRON_mix_recordings_GSM.pl $home/`;
`cp -f ./AST_DB_optimize.pl $home/`;
`cp -f ./AST_flush_DBqueue.pl $home/`;
`cp -f ./AST_manager_kill_hung_congested.pl $home/`;
`cp -f ./AST_manager_listen.pl $home/`;
`cp -f ./AST_manager_send.pl $home/`;
`cp -f ./AST_reset_mysql_vars.pl $home/`;
`cp -f ./AST_send_action_child.pl $home/`;
`cp -f ./AST_SERVER_conf.pl $home/`;
`cp -f ./AST_update.pl $home/`;
`cp -f ./AST_VDauto_dial.pl $home/`;
`cp -f ./AST_VDhopper.pl $home/`;
`cp -f ./AST_VDremote_agents.pl $home/`;
`cp -f ./AST_vm_update.pl $home/`;
`cp -f ./phone_codes_GMT.txt $home/`;
`cp -f ./start_asterisk_boot.pl $home/`;
`cp -f ./VICIDIAL_IN_new_leads_file.pl $home/`;
`cp -f ./test_VICIDIAL_lead_file.txt $home/VICIDIAL/LEADS_IN/`;
print "setting cron scripts to executable...\n";
`chmod 0755 $home/*`;
print "Copying agi-bin scripts...\n";
`cp -f ./agi-dtmf.agi $agibin/`;
`cp -f ./agi-record_prompts.agi $agibin/`;
`cp -f ./agi-VDAD_LB_closer.agi $agibin/`;
`cp -f ./agi-VDAD_LB_closer_inbound.agi $agibin/`;
`cp -f ./agi-VDAD_LB_transfer.agi $agibin/`;
`cp -f ./agi-VDAD_LO_closer.agi $agibin/`;
`cp -f ./agi-VDAD_LO_closer_inbound.agi $agibin/`;
`cp -f ./agi-VDAD_LO_transfer.agi $agibin/`;
`cp -f ./agi-VDADautoREMINDER.agi $agibin/`;
`cp -f ./agi-VDADautoREMINDERxfer.agi $agibin/`;
`cp -f ./agi-VDADcloser.agi $agibin/`;
`cp -f ./agi-VDADcloser_inbound.agi $agibin/`;
`cp -f ./agi-VDADcloser_inbound_5ID.agi $agibin/`;
`cp -f ./agi-VDADcloser_inbound_NOCID.agi $agibin/`;
`cp -f ./agi-VDADcloser_inboundANI.agi $agibin/`;
`cp -f ./agi-VDADcloser_inboundCID.agi $agibin/`;
`cp -f ./agi-VDADcloser_inboundCIDlookup.agi $agibin/`;
`cp -f ./agi-VDADcloser_PHONE.agi $agibin/`;
`cp -f ./agi-VDADtransfer.agi $agibin/`;
`cp -f ./agi-VDADtransferSURVEY.agi $agibin/`;
`cp -f ./call_inbound.agi $agibin/`;
`cp -f ./call_log.agi $agibin/`;
`cp -f ./call_logCID.agi $agibin/`;
`cp -f ./call_park.agi $agibin/`;
`cp -f ./call_park_EXT.agi $agibin/`;
`cp -f ./call_park_I.agi $agibin/`;
`cp -f ./call_park_L.agi $agibin/`;
`cp -f ./call_park_W.agi $agibin/`;
`cp -f ./debug_speak.agi $agibin/`;
`cp -f ./invalid_speak.agi $agibin/`;
`cp -f ./park_CID.agi $agibin/`;
`cp -f ./VD_amd.agi $agibin/`;
`cp -f ./VD_amd_post.agi $agibin/`;
`cp -f ./VD_hangup.agi $agibin/`;
print "setting agi-bin scripts to executable...\n";
`chmod 0755 $agibin/*`;
print "Copying sounds...\n";
`cp -f ./DTMF_sounds/* $sounds/`;
print "Creating vicidial web directory...\n";
`mkdir $webroot/vicidial/`;
`mkdir $webroot/vicidial/ploticus/`;
`mkdir $webroot/vicidial/agent_reports/`;
print "Copying VICIDIALweb php files...\n";
`cp -f ./VICIDIAL_web/* $webroot/vicidial/`;
print "setting VICIDIALweb scripts to executable...\n";
`chmod -R 0755 $webroot/vicidial/`;
`chmod 0777 $webroot/vicidial/`;
`chmod 0777 $webroot/vicidial/ploticus/`;
`chmod 0777 $webroot/vicidial/agent_reports/`;
print "Creating agc web directory...\n";
`mkdir $webroot/agc/`;
print "Copying agc php files...\n";
`cp -R -f ./agc/* $webroot/agc/`;
print "setting agc scripts to executable...\n";
`chmod -R 0755 $webroot/agc/`;
`chmod 0777 $webroot/agc/`;
print "Creating astguiclient web directory...\n";
`mkdir $webroot/astguiclient/`;
print "Copying astguiclient web php files...\n";
`cp -f ./astguiclient_web/* $webroot/astguiclient/`;
print "setting astguiclient web scripts to executable...\n";
`chmod -R 0755 $webroot/astguiclient/`;
`chmod 0777 $webroot/astguiclient/`;
}
$secy = time(); $secz = ($secy - $secX); $minz = ($secz/60); # calculate script runtime so far
print "\n - process runtime ($secz sec) ($minz minutes)\n";
print "\n\nDONE and EXITING\n";
exit;