Changeset 5749

Show
Ignore:
Timestamp:
04/24/08 15:07:00 (4 months ago)
Author:
p_lindheimer
Message:

Merged revisions 5748 via svnmerge from
http://svn.freepbx.org/freepbx/trunk

........

r5748 | p_lindheimer | 2008-04-24 15:05:50 -0700 (Thu, 24 Apr 2008) | 1 line


#2799 create include files needed by manager.conf prior before issuing reload in install script and add new from of reload for 1.6 and beyond syntax

........

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.4

    • Property svnmerge-integrated changed from /freepbx/branches/2.3:1-4129,4131,4133-4134,4136-4995,5088,5135,5140,5194 /freepbx/trunk:1-5453,5736,5739 to /freepbx/branches/2.3:1-4129,4131,4133-4134,4136-4995,5088,5135,5140,5194 /freepbx/trunk:1-5453,5736,5739,5748
  • freepbx/branches/2.4/install_amp

    r5738 r5749  
    10101010        out("done"); 
    10111011 
     1012        /* As of Asterisk 1.4.16 or there abouts, a missing #include file will make the reload fail. So 
     1013        we need to make sure that we have such for everything that is in our configs. We will simply 
     1014                look for the #include statements and touch the files vs. trying to inventory everything we may 
     1015                need and then forgetting something. 
     1016        */ 
     1017 
     1018        outn("creating missing #include files.."); 
     1019        $include_err = false; 
     1020        exec("grep '#include' ".$amp_conf['ASTETCDIR']."/*.conf | sed 's/;.*//; s/#include//'",$output,$retcode); 
     1021        if ($retcode != 0) { 
     1022                out("Error code $retcode: trying to search for missing #include files"); 
     1023                $include_err = true; 
     1024        } 
     1025 
     1026        foreach($output as $file) { 
     1027                if (trim($file) == '') { 
     1028                        continue; 
     1029                } 
     1030                $parse1 = explode(':',$file); 
     1031                $parse2 = explode(';',$parse1[1]); 
     1032                $rawfile = trim($parse2[0]); 
     1033                if ($rawfile == '') { 
     1034                        continue; 
     1035                } 
     1036 
     1037                $target = ($rawfile[0] == '/') ? $rawfile : $amp_conf['ASTETCDIR']."/$rawfile"; 
     1038 
     1039                if (!file_exists($target)) { 
     1040                        exec("touch $target", $output, $retcode); 
     1041                                if ($retcode != 0) { 
     1042                                out("Error code $retcode: trying to create empty file $target"); 
     1043                                $include_err = true; 
     1044                        } 
     1045                } 
     1046        } 
     1047        if (! $include_err) { 
     1048                out("OK"); 
     1049        } 
    10121050        // reload manager in asterisk if it was running: 
     1051        // Execute the 1.4+ syntax and the 1.2 syntax, it will reload twice on 1.4 and in the other cases 
     1052        // it will simply ignore the command since it has been removed. (not worth trying to figure out what 
     1053        // version they have... 
    10131054        // 
     1055        system("asterisk -rx 'module reload manager'"); 
    10141056        system("asterisk -rx 'reload manager'"); 
    10151057} 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads