Changeset 701
- Timestamp:
- 10/26/05 13:01:30 (7 years ago)
- Files:
-
- branches/AMP-1-10-010/AMP/install_amp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/AMP-1-10-010/AMP/install_amp
r698 r701 59 59 out(" --dry-run Don't actually do anything"); 60 60 out(" --force-version <ver> Force upgrade from version <ver>"); 61 out(" --dbhost <ip address> Use a remote database server"); 61 62 } 62 63 … … 391 392 */ 392 393 function collect_settings($filename) { 394 global $dbhost; 393 395 out("Creating new /etc/amportal.conf"); 394 396 … … 421 423 break; 422 424 } else if (mkdir($amp_conf["AMPWEBROOT"],755)){ 423 outn("Created ".$amp_conf["AMPWEBROOT"] });425 outn("Created ".$amp_conf["AMPWEBROOT"]); 424 426 break; 425 427 } else { … … 436 438 break; 437 439 } else if (mkdir($amp_conf["FOPWEBROOT"],755)){ 438 outn("Created ".$amp_conf["FOPWEBROOT"] });440 outn("Created ".$amp_conf["FOPWEBROOT"]); 439 441 break; 440 442 } else { … … 475 477 break; 476 478 } else if (mkdir($amp_conf["AMPBIN"],755)){ 477 outn("Created ".$amp_conf["AMPBIN"] });479 outn("Created ".$amp_conf["AMPBIN"]); 478 480 break; 479 481 } else { … … 490 492 break; 491 493 } else if (mkdir($amp_conf["AMPSBIN"],755)){ 492 outn("Created ".$amp_conf["AMPSBIN"] });494 outn("Created ".$amp_conf["AMPSBIN"]); 493 495 break; 494 496 } else { … … 496 498 } 497 499 } while(1); 500 501 if (isset($dbhost)) { 502 $amp_conf["AMPDBHOST"] = $dbhost; 503 } else { 504 $amp_conf["AMPDBHOST"] = 'localhost'; 505 } 498 506 499 507 // write amportal.conf … … 537 545 538 546 $shortopts = "h?u:p:"; 539 $longopts = array("help","debug","dry-run","username=","password=","force-version=" );547 $longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost="); 540 548 541 549 $args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); … … 575 583 out("Forcing upgrade from version ".$version); 576 584 break; 585 case "--dbhost": 586 $dbhost = $arg[1]; 587 out("Using remote database server at ".$dbhost); 588 break; 577 589 } 578 590 } … … 609 621 out("OK"); 610 622 611 if (isset($new_username) || isset($new_password) ) {623 if (isset($new_username) || isset($new_password) || isset($dbhost)) { 612 624 // new username/pwd 613 625 … … 617 629 if (isset($new_password)) { 618 630 $amp_conf["AMPDBPASS"] = $new_password; 631 } 632 633 if (isset($dbhost)) { 634 $amp_conf["AMPDBHOST"] = $dbhost; 619 635 } 620 636 … … 638 654 $db_user = $amp_conf["AMPDBUSER"]; 639 655 $db_pass = $amp_conf["AMPDBPASS"]; 640 $db_host = 'localhost';656 $db_host = $amp_conf["AMPDBHOST"]; 641 657 $db_name = 'asterisk'; 642 658 $db_engine = 'mysql';
