[fix] replace "sh" by "bash" for force shell interpreter

[fix] dir "/cache/cronTask/" not create in not existe
This commit is contained in:
Knah Tsaeb 2013-08-16 13:53:55 +02:00
parent 3eaea010ce
commit 04a2abeb97
2 changed files with 9 additions and 3 deletions

View File

@ -7,7 +7,7 @@ do
then
while read site hashUrl thumbSize sizeNameDir onlyThumb
do
sh thumb_server.sh "$site" "$hashUrl" "$thumbSize" "$sizeNameDir" "$onlyThumb" "0"
bash thumb_server.sh "$site" "$hashUrl" "$thumbSize" "$sizeNameDir" "$onlyThumb" "0"
rm $file
done < $file
fi

View File

@ -147,9 +147,9 @@ function launchScript($url, $hashUrl, $width, $size, $onlyThumb, $waitForResult
if ($GLOBALS['config']['disableExec'] === false) {
chdir('bin/');
if ($waitForResult === false) {
exec('sh thumb_server.sh '.$url.' '.$hashUrl.' '.$width.' '.$size.' '.$onlyThumb.' > /dev/null &', $result);
exec('bash thumb_server.sh '.$url.' '.$hashUrl.' '.$width.' '.$size.' '.$onlyThumb.' > /dev/null &', $result);
} else {
exec('sh thumb_server.sh '.$url.' '.$hashUrl.' '.$width.' '.$size.' '.$onlyThumb.' 1', $result);
exec('bash thumb_server.sh '.$url.' '.$hashUrl.' '.$width.' '.$size.' '.$onlyThumb.' 1', $result);
}
chdir('../');
} else {
@ -257,6 +257,9 @@ function install() {
if (!is_dir('cache/tmp') && !mkdir('cache/tmp', 0705)) {
die('Error on create dir "cache/tmp".');
}
if (!is_dir('cache/cronTask') && !mkdir('cache/cronTask', 0705)) {
die('Error on create dir "cache/cronTask".');
}
$salt = sha1(uniqid(rand(), true).'_'.mt_rand());
$serverKey = substr(sha1(uniqid(rand(), true).'_'.mt_rand().$salt), 0, 12);
$encryptServerKey = sha1($serverKey.$salt);
@ -292,6 +295,9 @@ function checkInstall() {
if (!is_file('cache/config/.htaccess')) {
file_put_contents('cache/config/.htaccess', "Allow from none\nDeny from all\n");
}
if (!is_file('cache/cronTask/.htaccess')) {
file_put_contents('cache/config/.htaccess', "Allow from none\nDeny from all\n");
}
if (!is_file('bin/.htaccess')) {
file_put_contents('bin/.htaccess', "Allow from none\nDeny from all\n");
}