Ticket #1283: install_amp.without-fop-option.patch
| File install_amp.without-fop-option.patch, 4.6 kB (added by splat, 6 years ago) |
|---|
-
install_amp
old new 77 77 out(" --dbname databasename Use database name specified, instead of 'asterisk'"); 78 78 out(" --username <user> Use <user> to connect to db and write config"); 79 79 out(" --password <pass> Use <pass> to connect to db and write config"); 80 out(" --without-fop Don't Install Flash Operator Panel"); 80 81 /* out(" --fopwebroot <path> Web path where fop will be installed"); 81 82 out(" --webroot <path> Web root where freepbx will be installed"); 82 83 out(" --cgibin <path> Path where cgi-bin's lives"); … … 252 253 global $check_md5s; 253 254 global $amp_conf; 254 255 global $asterisk_conf; 256 global $withfop; 255 257 256 258 if ($dirsource && ($dirsource[0] != "/")) $dirsource = "/".$dirsource; 257 259 … … 270 272 271 273 // configurable in amportal.conf 272 274 if (strpos($destination,"htdocs_panel")) { 273 $destination=str_replace("/htdocs_panel",trim($amp_conf["FOPWEBROOT"]),$destination); 275 if ($withfop != "No") 276 { 277 $destination=str_replace("/htdocs_panel",trim($amp_conf["FOPWEBROOT"]),$destination); 278 } 274 279 } else { 275 280 $destination=str_replace("/htdocs",trim($amp_conf["AMPWEBROOT"]),$destination); 276 281 } 277 $destination=str_replace("/htdocs_panel",trim($amp_conf["FOPWEBROOT"]),$destination); 282 if ($withfop != "No") 283 { 284 $destination=str_replace("/htdocs_panel",trim($amp_conf["FOPWEBROOT"]),$destination); 285 } 278 286 // $destination=str_replace("/cgi-bin",trim($amp_conf["AMPCGIBIN"]),$destination); 279 287 $destination=str_replace("/bin",trim($amp_conf["AMPBIN"]),$destination); 280 288 $destination=str_replace("/sbin",trim($amp_conf["AMPSBIN"]),$destination); … … 466 474 /** Collect AMP settings 467 475 */ 468 476 function collect_settings($filename, $dbhost = '', $dbuser = '', $dbpass = '', $dbname = 'asterisk') { 477 global $withfop; 469 478 out("Creating new $filename"); 470 479 471 480 outn("Enter your USERNAME to connect to the '$dbname' database:\n [".($dbuser ? $dbuser : "asteriskuser")."] "); … … 516 525 if (preg_match('/^$/',$key)) $amp_conf["AMPWEBADDRESS"] = "xx.xx.xx.xx"; 517 526 else $amp_conf["AMPWEBADDRESS"] = $key; 518 527 519 outn("Enter a PASSWORD to perform call transfers with the Flash Operator Panel:\n [passw0rd] "); 520 $key = trim(fgets(STDIN,1024)); 521 if (preg_match('/^$/',$key)) $amp_conf["FOPPASSWORD"] = "passw0rd"; 522 else $amp_conf["FOPPASSWORD"] = $key; 523 528 if ($withfop != "No") 529 { 530 outn("Enter a PASSWORD to perform call transfers with the Flash Operator Panel:\n [passw0rd] "); 531 $key = trim(fgets(STDIN,1024)); 532 if (preg_match('/^$/',$key)) $amp_conf["FOPPASSWORD"] = "passw0rd"; 533 else $amp_conf["FOPPASSWORD"] = $key; 534 } 535 524 536 outn("Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?\n [extensions] "); 525 537 $key = trim(fgets(STDIN,1024)); 526 538 if (preg_match('/^$/',$key)) $amp_conf["AMPEXTENSIONS"] = "extensions"; … … 593 605 594 606 // **** Parse out command-line options 595 607 $shortopts = "h?u:p:"; 596 $longopts = array("help","debug","dry-run","username=","password="," force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine");608 $longopts = array("help","debug","dry-run","username=","password=","without-fop","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine"); 597 609 598 610 $args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); 599 611 if (is_object($args)) { … … 612 624 $dbname = null; 613 625 $new_username = null; 614 626 $new_password = null; 627 $withfop = null; 615 628 616 629 foreach ($args[0] as $arg) { 617 630 switch ($arg[0]) { … … 635 648 out("Using password: ".str_repeat("*",strlen($arg[1]))); 636 649 $new_password = $arg[1]; 637 650 break; 651 case "--without-fop": 652 out("Not Installing Flash Operator Panel"); 653 $withfop = "No"; 654 break; 638 655 case "--force-version": 639 656 $version = $arg[1]; 640 657 out("Forcing upgrade from version ".$version); … … 1031 1048 out("Generating AMP configs..OK"); 1032 1049 1033 1050 // **** Bounce FOP 1034 outn("Restarting Flash Operator Panel.."); 1035 exec('su - asterisk -c "'.$amp_conf["AMPWEBROOT"].'/admin/bounce_op.sh"'); 1036 out("OK"); 1051 if ($withfop != "No") 1052 { 1053 outn("Restarting Flash Operator Panel.."); 1054 exec('su - asterisk -c "'.$amp_conf["AMPWEBROOT"].'/admin/bounce_op.sh"'); 1055 out("OK"); 1056 } 1037 1057 1038 1058 $version = install_getversion(); 1039 1059 $filename = $amp_conf["AMPWEBROOT"]."/admin/version.txt";
