From 04a2abeb97cea8d85ad81309ee0317e77f9d057b Mon Sep 17 00:00:00 2001 From: Knah Tsaeb Date: Fri, 16 Aug 2013 13:53:55 +0200 Subject: [PATCH] [fix] replace "sh" by "bash" for force shell interpreter [fix] dir "/cache/cronTask/" not create in not existe --- bin/cronTask.sh | 2 +- index.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/cronTask.sh b/bin/cronTask.sh index e9d37dc..b070ea2 100644 --- a/bin/cronTask.sh +++ b/bin/cronTask.sh @@ -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 diff --git a/index.php b/index.php index 383e03c..5ed1790 100644 --- a/index.php +++ b/index.php @@ -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"); }