Changeset 2092

Show
Ignore:
Timestamp:
06/25/06 21:08:53 (7 years ago)
Author:
qldrob
Message:

Start of support for #761 - tidying up install_amp.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/install_amp

    r2090 r2092  
    6868  out("Optional parameters:"); 
    6969  out("  --help, -h, -?           Show this help"); 
     70  out("  --dbhost <ip address>    Use a remote database server"); 
     71  out("  --dbname databasename    Use database name specified, instead of 'asterisk'"); 
    7072  out("  --username <user>        Use <user> to connect to db and write config"); 
    7173  out("  --password <pass>        Use <pass> to connect to db and write config"); 
     74/*  out("  --fopwebroot <path>      Web path where fop will be installed"); 
     75  out("  --webroot <path>         Web root where freepbx will be installed"); 
     76  out("  --cgibin <path>          Path where cgi-bin's lives"); 
     77  out("  --bin <path>             Path of asterisk binaries"); 
     78  out("  --sbin <path>            Path of system admin binaries"); 
     79  out("  --asteriskuser <user>    Asterisk Manager username"); 
     80  out("  --asteriskpass <pass>    Asterisk Manager password"); 
     81  out("  --systemconfig <path>    System config files"); */ 
    7282  out("  --debug                  Enable debug output"); 
    7383  out("  --dry-run                Don't actually do anything"); 
    7484  out("  --force-version <ver>    Force upgrade from version <ver>"); 
    75   out("  --dbhost <ip address>    Use a remote database server"); 
    76   out("  --dbname databasename    Use database name specified, instead of 'asterisk'"); 
    7785  out("  --no-files               Just run updates without installing files"); 
    7886} 
     
    420428 */ 
    421429function collect_settings($filename, $dbhost = '', $dbuser = '', $dbpass = '', $dbname = 'asterisk') { 
    422   out("Creating new /etc/amportal.conf"); 
     430  out("Creating new $filename"); 
    423431   
    424432  outn("Enter your USERNAME to connect to the '$dbname' database:\n [".($dbuser ? $dbuser : "asteriskuser")."] "); 
     
    533541  // write amportal.conf 
    534542  write_amportal_conf($filename, $amp_conf); 
    535   outn("/etc/amportal.conf written"); 
     543  outn(AMP_CONF." written"); 
    536544} 
    537545 
     
    625633      out("Running upgrade only, without installing files."); 
    626634    break; 
     635/*    case "--fopwebroot": 
     636      $fopwebroot = $arg[1]; 
     637      out("Using fop at ".$fopwebroot); 
     638    break; 
     639    case "--webroot": 
     640      $webroot = $arg[1]; 
     641      out("Using Webroot at ".$webroot); 
     642    break; 
     643    case "--cgibin": 
     644      $cgibin = $arg[1]; 
     645      out("Using CGI-BIN at ".$cgibin); 
     646    break; 
     647    case "--bin": 
     648      $bin = $arg[1]; 
     649      out("Using bin at ".$bin); 
     650    break; 
     651    case "--sbin": 
     652      $sbin = $arg[1]; 
     653      out("Using sbin ar ".$sbin); 
     654    break; 
     655    case "--asteriskuser": 
     656      $asteriskuser = $arg[1]; 
     657      out("Using Asterisk user ".$asteriskuser); 
     658    break; 
     659    case "--asteriskpass": 
     660      $asteriskpass = $arg[1]; 
     661      out("Using asteriskpass ".str_repeat("*",strlen($arg[1]))); 
     662    break; 
     663    case "--systemconfig": 
     664      $systemconfig = $arg[1]; 
     665      out("Using system config at ". $systemconfig); 
     666    break; */ 
     667 
    627668  } 
    628669} 
     
    647688if (!file_exists(AMP_CONF)) { 
    648689  out(AMP_CONF." does not exist, copying default"); 
    649   copy("amportal.conf", "/etc/amportal.conf"); 
     690  copy("amportal.conf", AMP_CONF); 
    650691  collect_settings(AMP_CONF, $dbhost, $new_username, $new_password, $dbname); 
    651692} 
     
    716757if (!file_exists(ASTERISK_CONF)) { 
    717758  out(ASTERISK_CONF." does not exist, copying default"); 
    718   copy("asterisk.conf", "/etc/asterisk/asterisk.conf"); 
     759  copy("asterisk.conf", AMP_CONF); 
    719760} 
    720761out("OK"); 
     
    795836   
    796837    if (!isset($amp_conf["AMPDBFILE"])) 
    797       die("You must setup properly AMPDBFILE in /etc/amportal.conf"); 
     838      die("You must setup properly AMPDBFILE in ".AMP_CONF); 
    798839   
    799840    if (isset($amp_conf["AMPDBFILE"]) == "") 
    800       die("AMPDBFILE in /etc/amportal.conf cannot be blank"); 
     841      die("AMPDBFILE in ".AMP_CONF." cannot be blank"); 
    801842   
    802843    $DSN = array (