Changeset 3436
- Timestamp:
- 12/28/06 23:24:26 (5 years ago)
- Files:
-
- freepbx/trunk/install_amp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/install_amp
r3366 r3436 48 48 ); 49 49 50 define("REQ_ASTERISK_VERSION", "1.2");51 50 52 51 /********************************************************************************************************************/ … … 97 96 out(" it's a new installation)"); 98 97 out(" --my-svn-is-correct Ignore Asterisk version, assume it is correct"); 99 out(" --engine <name> Use the specified PBX Engine ('asterisk' or 'openpbx')");98 out(" --engine <name> Use the specified PBX Engine ('asterisk', 'asterisk14' or 'openpbx')"); 100 99 } 101 100 … … 627 626 // **** Parse out command-line options 628 627 $shortopts = "h?u:p:"; 629 $longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine ","install-moh");628 $longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine=","install-moh"); 630 629 631 630 $args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); … … 691 690 break; 692 691 case "--engine": 692 if ($arg[1] != 'asterisk' && $arg[1] != 'asterisk14' && $arg[1] != 'openpbx') { 693 fatal('Currently only "asterisk", "asterisk14" or "openpbx" are supported as a PBX engine'); 694 } 693 695 $pbx_engine = $arg[1]; 694 if ($pbx_engine != 'asterisk') {695 fatal('Currently only "asterisk" is supported as a PBX engine');696 }697 696 break; 698 697 case "--install-moh": … … 880 879 881 880 // **** Check asterisk verison 882 883 outn("Checking for Asterisk ".REQ_ASTERISK_VERSION.".."); 881 // Set the 'engine' to be 'asterisk14' if using asterisk 1.4, otherwise 882 // 'asterisk' 883 outn("Checking for Asterisk version.."); 884 884 if (preg_match('/^Asterisk (\d+(\.\d+)*)(-?(.*))$/', $verinfo, $matches)) { 885 if (version_compare($matches[1], REQ_ASTERISK_VERSION) < 0) { 886 fatal("Asterisk ".REQ_ASTERISK_VERSION." is required for this version of freePBX"); 887 } 885 if (version_compare($matches[1], "1.2") < 0) { 886 fatal("At least Asterisk 1.2 is required for this version of freePBX"); 887 } 888 if (version_compare($matches[1], "1.4", "ge")) 888 889 out("OK"); 889 890 } elseif (preg_match('/^Asterisk SVN.+/', $verinfo)) { … … 893 894 out("that your Asterisk version is compatible with FreePBX. Whilst this probably"); 894 895 out("won't cause any problems, YOU NEED TO BE CERTAIN that it is compatible"); 895 out("with at least the released Asterisk version ".REQ_ASTERISK_VERSION."." );896 out("with at least the released Asterisk version 1.2" ); 896 897 if ($override_astvers==false) { 897 898 out("If you are SURE that this is compatible, you can re-run ".$argv[0]." with");
