EC-Cubeインストール時のアクセス権設定
12 / 4 / 2009

#!/usr/bin/perl

print “Pragma: no-cache\n”;
print “Cache-Control: no-cache\n”;
print “Content-type: text/html; charset=UTF-8\n\n”;
print “<html><head><title>chmod</title></head><body>”;

$cnt = 0;
my @dirs = (‘./’);
while($cnt < @dirs){
$dir = $dirs[$cnt];
opendir DH, $dir or die “$dir:$!”;
while (my $file = readdir DH) {
next if $file =~ /^\.{1,2}$/;
$checkdir = $dir . $file;
my(@type) = split(/\./,$checkdir);
if(-d $checkdir){
chmod 0707, $checkdir;
push @dirs, “${checkdir}/”;
}
elsif($type[-1] eq “png”){
chmod 0606, $checkdir;
}
elsif($type[-1] eq “gif”){
chmod 0606, $checkdir;
}
elsif($type[-1] eq “jpg”){
chmod 0606, $checkdir;
}
elsif($type[-1] eq “css”){
chmod 0606, $checkdir;
}
elsif($type[-1] eq “sql”){
chmod 0606, $checkdir;
}
elsif($type[-1] eq “CSV”){
chmod 0606, $checkdir;
}
elsif($type[-1] eq “js”){
chmod 0606, $checkdir;
}
elsif($type[-1] eq “php”){
chmod 0606, $checkdir;
}
elsif($type[-1] eq “tpl”){
chmod 0606, $checkdir;
}
}
closedir DH;
$cnt++;
}

@dummy = (‘./html/user_data/dummy’,
‘./html/user_data/include/campaign/dummy’,
‘./html/cp/dummy’,
‘./html/upload/dummy’,
‘./data/cache/dummy’,
‘./data/Smarty/config/dummy’,
‘./data/Smarty/templates_c/dummy’,
‘./data/logs/dummy’,
‘./data/downloads/dummy’
);
foreach(@dummy){
chmod 0606,$_;
}

print “PROCESSING COMPLETION</body></html>”;
exit;

Tags:

コメントする

Grow!

About this entry

EC-Cubeインストール時のアクセス権設定

Posted in 12 / 4 / 2009

Tags:

Bookmark

Share