Changeset 2035

Show
Ignore:
Timestamp:
06/05/06 06:42:36 (7 years ago)
Author:
diego_iastrubni
Message:

another backport: perl scripts now read the configuration directly from amportal.conf
TODO:
the requires keyword is hard coded, and should be modified by the apply_conf. somehow.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/1.0/amp_conf/htdocs/admin/retrieve_extensions_from_mysql.pl

    r611 r2035  
    2121 
    2222use DBI; 
     23require "/var/www/html/admin/retrieve_parse_amportal_conf.pl"; 
     24 
    2325################### BEGIN OF CONFIGURATION #################### 
    2426 
     
    3032# WARNING: this file will be substituted by the output of this program 
    3133$extensions_conf = "/etc/asterisk/extensions_additional.conf"; 
    32 # the name of the box the MySQL database is running on 
    33 $hostname = "localhost"; 
     34 
    3435# the name of the database our tables are kept 
    3536$database = "asterisk"; 
     37 
     38# cool hack by Julien BLACHE <jblache@debian.org> 
     39$ampconf = parse_amportal_conf( "/etc/amportal.conf" ); 
    3640# username to connect to the database 
    37 $username = "AMPDBUSER"
     41$username = $ampconf->{"AMPDBUSER"}
    3842# password to connect to the database 
    39 $password = "AMPDBPASS"; 
     43$password = $ampconf->{"AMPDBPASS"}; 
     44# the name of the box the MySQL database is running on 
     45$hostname = $ampconf->{"AMPDBHOST"}; 
     46 
    4047 
    4148################### END OF CONFIGURATION ####################### 
  • freepbx/branches/1.0/amp_conf/htdocs/admin/retrieve_iax_conf_from_mysql.pl

    r337 r2035  
    88 
    99use DBI; 
     10require "/var/www/html/admin/retrieve_parse_amportal_conf.pl"; 
     11 
    1012################### BEGIN OF CONFIGURATION #################### 
    1113 
     
    1517# WARNING: this file will be substituted by the output of this program 
    1618$iax_conf = "/etc/asterisk/iax_additional.conf"; 
    17 # the name of the box the MySQL database is running on 
    18 $hostname = "localhost"; 
    1919# the name of the database our tables are kept 
    2020$database = "asterisk"; 
     21 
     22# cool hack by Julien BLACHE <jblache@debian.org> 
     23$ampconf = parse_amportal_conf( "/etc/amportal.conf" ); 
    2124# username to connect to the database 
    22 $username = "AMPDBUSER"
     25$username = $ampconf->{"AMPDBUSER"}
    2326# password to connect to the database 
    24 $password = "AMPDBPASS"; 
     27$password = $ampconf->{"AMPDBPASS"}; 
     28# the name of the box the MySQL database is running on 
     29$hostname = $ampconf->{"AMPDBHOST"}; 
    2530 
    2631################### END OF CONFIGURATION ####################### 
  • freepbx/branches/1.0/amp_conf/htdocs/admin/retrieve_meetme_conf_from_mysql.pl

    r112 r2035  
    88 
    99use DBI; 
     10require "/var/www/html/admin/retrieve_parse_amportal_conf.pl"; 
     11 
    1012################### BEGIN OF CONFIGURATION #################### 
    1113 
     
    1517# WARNING: this file will be substituted by the output of this program 
    1618$meetme_conf = "/etc/asterisk/meetme_additional.conf"; 
    17 # the name of the box the MySQL database is running on 
    18 $hostname = "localhost"; 
    1919# the name of the database our tables are kept 
    2020$database = "asterisk"; 
     21 
     22# cool hack by Julien BLACHE <jblache@debian.org> 
     23$ampconf = parse_amportal_conf( "/etc/amportal.conf" ); 
    2124# username to connect to the database 
    22 $username = "AMPDBUSER"
     25$username = $ampconf->{"AMPDBUSER"}
    2326# password to connect to the database 
    24 $password = "AMPDBPASS"; 
     27$password = $ampconf->{"AMPDBPASS"}; 
     28# the name of the box the MySQL database is running on 
     29$hostname = $ampconf->{"AMPDBHOST"}; 
     30 
    2531 
    2632################### END OF CONFIGURATION ####################### 
  • freepbx/branches/1.0/amp_conf/htdocs/admin/retrieve_op_conf_from_mysql.pl

    r751 r2035  
    88 
    99use DBI; 
     10require "/var/www/html/admin/retrieve_parse_amportal_conf.pl"; 
     11 
    1012################### BEGIN OF CONFIGURATION #################### 
    1113 
     
    8991# WARNING: this file will be substituted by the output of this program 
    9092$op_conf = "AMPWEBROOT/panel/op_buttons_additional.cfg"; 
    91 # the name of the box the MySQL database is running on 
    92 $hostname = "localhost"; 
    9393# the name of the database our tables are kept 
    9494$database = "asterisk"; 
    95 # username to connect to the database 
    96 $username = "AMPDBUSER"; 
    97 # password to connect to the database 
    98 $password = "AMPDBPASS"; 
    9995# sort option: extension or lastname 
    10096$sortoption = "extension"; 
     97 
     98# cool hack by Julien BLACHE <jblache@debian.org> 
     99$ampconf = parse_amportal_conf( "/etc/amportal.conf" ); 
     100# username to connect to the database 
     101$username = $ampconf->{"AMPDBUSER"}; 
     102# password to connect to the database 
     103$password = $ampconf->{"AMPDBPASS"}; 
     104# the name of the box the MySQL database is running on 
     105$hostname = $ampconf->{"AMPDBHOST"}; 
     106 
    101107 
    102108################### END OF CONFIGURATION ####################### 
  • freepbx/branches/1.0/amp_conf/htdocs/admin/retrieve_queues_from_mysql.pl

    r138 r2035  
    44 
    55use DBI; 
     6require "/var/www/html/admin/retrieve_parse_amportal_conf.pl"; 
     7 
    68################### BEGIN OF CONFIGURATION #################### 
    79 
     
    1113# WARNING: this file will be substituted by the output of this program 
    1214$queues_conf = "/etc/asterisk/queues_additional.conf"; 
    13 # the name of the box the MySQL database is running on 
    14 $hostname = "localhost"; 
    1515# the name of the database our tables are kept 
    1616$database = "asterisk"; 
     17 
     18# cool hack by Julien BLACHE <jblache@debian.org> 
     19$ampconf = parse_amportal_conf( "/etc/amportal.conf" ); 
    1720# username to connect to the database 
    18 $username = "AMPDBUSER"
     21$username = $ampconf->{"AMPDBUSER"}
    1922# password to connect to the database 
    20 $password = "AMPDBPASS"; 
     23$password = $ampconf->{"AMPDBPASS"}; 
     24# the name of the box the MySQL database is running on 
     25$hostname = $ampconf->{"AMPDBHOST"}; 
    2126 
    2227################### END OF CONFIGURATION ####################### 
  • freepbx/branches/1.0/amp_conf/htdocs/admin/retrieve_sip_conf_from_mysql.pl

    r337 r2035  
    88 
    99use DBI; 
     10require "/var/www/html/admin/retrieve_parse_amportal_conf.pl"; 
     11 
    1012################### BEGIN OF CONFIGURATION #################### 
    1113 
     
    1517# WARNING: this file will be substituted by the output of this program 
    1618$sip_conf = "/etc/asterisk/sip_additional.conf"; 
    17 # the name of the box the MySQL database is running on 
    18 $hostname = "localhost"; 
    1919# the name of the database our tables are kept 
    2020$database = "asterisk"; 
     21 
     22# cool hack by Julien BLACHE <jblache@debian.org> 
     23$ampconf = parse_amportal_conf( "/etc/amportal.conf" ); 
    2124# username to connect to the database 
    22 $username = "AMPDBUSER"
     25$username = $ampconf->{"AMPDBUSER"}
    2326# password to connect to the database 
    24 $password = "AMPDBPASS"; 
     27$password = $ampconf->{"AMPDBPASS"}; 
     28# the name of the box the MySQL database is running on 
     29$hostname = $ampconf->{"AMPDBHOST"}; 
    2530 
    2631################### END OF CONFIGURATION ####################### 
  • freepbx/branches/1.0/amp_conf/htdocs/admin/retrieve_zap_conf_from_mysql.pl

    r91 r2035  
    88 
    99use DBI; 
     10require "/var/www/html/admin/retrieve_parse_amportal_conf.pl"; 
     11 
    1012################### BEGIN OF CONFIGURATION #################### 
    1113 
     
    1517# WARNING: this file will be substituted by the output of this program 
    1618$zap_conf = "/etc/asterisk/zapata_additional.conf"; 
    17 # the name of the box the MySQL database is running on 
    18 $hostname = "localhost"; 
    1919# the name of the database our tables are kept 
    2020$database = "asterisk"; 
     21 
     22# cool hack by Julien BLACHE <jblache@debian.org> 
     23$ampconf = parse_amportal_conf( "/etc/amportal.conf" ); 
    2124# username to connect to the database 
    22 $username = "AMPDBUSER"
     25$username = $ampconf->{"AMPDBUSER"}
    2326# password to connect to the database 
    24 $password = "AMPDBPASS"; 
     27$password = $ampconf->{"AMPDBPASS"}; 
     28# the name of the box the MySQL database is running on 
     29$hostname = $ampconf->{"AMPDBHOST"}; 
    2530 
    2631################### END OF CONFIGURATION ####################### 
  • freepbx/branches/1.0/apply_conf.sh

    r735 r2035  
    1 #!/bin/bash 
     1#!/bin/sh 
    22 
    33if [ "$1" == "-h" ] 
     
    2828source $AMPCONFIG 
    2929 
    30  
    3130echo "Updating configuration..." 
    3231 
     
    3635sed -r -i "s/hostname=[a-zA-Z0-9]*/hostname=$AMPDBHOST/" /etc/asterisk/cdr_mysql.conf 
    3736 
    38 # do a bunch at once here 
    39 find $AMPWEBROOT/admin/ -name retrieve\*.pl 
    40 sed -r -i "s/username = \"[a-zA-Z0-9]*\";/username = \"$AMPDBUSER\";/" `find $AMPWEBROOT/admin/ -name retrieve\*.pl` 
    41 sed -r -i "s/password = \"[a-zA-Z0-9]*\";/password = \"$AMPDBPASS\";/" `find $AMPWEBROOT/admin/ -name retrieve\*.pl` 
    42 sed -r -i "s/hostname = \"[a-zA-Z0-9]*\";/hostname = \"$AMPDBHOST\";/" `find $AMPWEBROOT/admin/ -name retrieve\*.pl` 
    43  
    4437# sort option for FOP 
    4538sed -r -i "s/sortoption = \"[a-zA-Z0-9]*\";/sortoption = \"$FOPSORT\";/" $AMPWEBROOT/admin/retrieve_op_conf_from_mysql.pl 
    46  
    4739sed -r -i "s!op_conf = \"[^\"]*\";!op_conf = \"$AMPWEBROOT\/panel\/op_buttons_additional.cfg\";!" $AMPWEBROOT/admin/retrieve_op_conf_from_mysql.pl 
    4840 
     
    6456sed -r -i "s!web_hostname=[a-zA-Z0-9\.]*!web_hostname=$AMPWEBADDRESS!" $FOPWEBROOT/op_server.cfg 
    6557 
    66  
    67  
    68  
    6958echo "/etc/asterisk/vm_email.inc" 
    7059sed -r -i "s!http://.*/cgi-bin!http://$AMPWEBADDRESS/cgi-bin!" /etc/asterisk/vm_email.inc 
     
    7564$AMPSBIN/amportal chown 
    7665echo "Done" 
    77 exit 
    78