Changeset 1210

Show
Ignore:
Timestamp:
06/14/08 17:59:59 (6 months ago)
Author:
rats
Message:

updated update script

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/engine/setup/ispcp-update

    r1207 r1210  
    664664        # 
    665665 
    666         my $cfg_dir = "$main::cfg{'CONF_DIR'}/apache"; 
    667         my $bk_dir = "$cfg_dir/backup"; 
     666        $cfg_dir = "$main::cfg{'CONF_DIR'}/apache"; 
     667        $bk_dir = "$cfg_dir/backup"; 
    668668 
    669669        ($rs, $cfg_tpl) = get_tpl("$cfg_dir/working", 'fastcgi_ispcp.conf'); 
    670670        return $rs if ($rs != 0); 
    671671 
    672         my %tag_hash = ( 
     672        %tag_hash = ( 
    673673                                        '{APACHE_SUEXEC_MIN_UID}' => $main::cfg{'APACHE_SUEXEC_MIN_UID'}, 
    674674                                        '{APACHE_SUEXEC_MIN_GID}' => $main::cfg{'APACHE_SUEXEC_MIN_GID'}, 
     
    713713} 
    714714 
    715 sub search_and_replace()
     715sub search_and_replace
    716716    my $dir = shift; 
     717    my ($cmd, $rs) = (undef, undef); 
     718 
    717719    if (opendir(DIRH, "$dir")) { 
    718720        foreach (readdir(DIRH)) { 
     
    720722            next if ($_ eq "." || $_ eq ".."); 
    721723            if (/$ARGV[0]/io) { 
    722                 $cmd = '$main::cfg{'CMD_SED} -i -e "s/\/phptmp\"/\/phptmp\//\"" php.ini'; 
     724                my $sed = $main::cfg{'CMD_SED'}; 
     725                $cmd = '$sed -i -e "s/\/phptmp\"/\/phptmp\//\"" php.ini'; 
    723726                                $rs = sys_command($cmd); 
    724727                                return $rs if ($rs != 0); 
     
    869872} 
    870873 
    871 sub patch_ispcp_rc3()
     874sub patch_ispcp_rc3
    872875        push_el(\@main::el, 'patch_ispcp_rc3()', 'Ending...'); 
    873876 
     
    907910} 
    908911 
    909 sub patch_ispcp_rc4()
     912sub patch_ispcp_rc4
    910913        push_el(\@main::el, 'patch_ispcp_rc4()', 'Starting...'); 
    911914 
    912         $rs = setup_mta(); 
     915        my $rs = setup_mta(); 
    913916        return 2 if ($rs != 0); 
    914917 
     
    917920 
    918921        # FastCGI-Security 
    919         search_and_replace($main::cfg{'PHP_STARTER_DIR'}); 
     922        search_and_replace("$main::cfg{'PHP_STARTER_DIR'}"); 
    920923 
    921924        # Update Apache 
     
    959962                        $rs = remove_vhcs2(); 
    960963                } 
    961                 if ($rs == 0) { 
    962                         $rs = patch_ispcp_rc3(); 
    963                 } 
    964                 if ($rs == 0) { 
    965                         $rs = patch_ispcp_rc4(); 
    966                 } 
    967964 
    968965                if ($rs != 0) { 
    969                 print STDOUT "\t Update failed!\n"; 
     966                print STDOUT "\tUpdate failed!\n"; 
    970967                        exit_werror("ispCP Update failed."); 
    971968                }