Correction script d'install

This commit is contained in:
Michael RICOIS 2011-03-29 13:46:21 +00:00
parent 1a401be3df
commit 1ba5a9873e

View File

@ -18,18 +18,22 @@ action :
}
$action = $argv[1];
$mode = strtoupper($argv[2]);
$hostname = exec('echo $(hostname)');
$wwwroot = realpath(dirname(__FILE__).'/../../');
switch ($action)
{
case 'configure':
if (!isRoot()) {
echo "Vous devez être ROOT pour utiliser ce script.\n";
exit;
}
writeConfig();
changePermission();
break;
case 'install':
/*
if (!isRoot()) {
echo "Vous devez être ROOT pour utiliser ce script.\n";
exit;
@ -37,7 +41,8 @@ switch ($action)
writeConfig();
changePermission();
changePrimarySymlink();
passthru('php ../batch/genwsdl.php all');
passthru('php ../batch/genwsdl.php --all --host wse.scores-decisions.com:8081');
*/
break;
}
@ -56,12 +61,13 @@ function isRoot()
function changePermission()
{
passthru('chown -R www-data: '.realpath(dirname(__FILE__).'/../'));
passthru('chmod +x '.realpath(dirname(__FILE__).'/../batch/*.php'));
passthru('chown -vR www-data: '.realpath(dirname(__FILE__).'/../'));
passthru('chmod -vR +x '.realpath(dirname(__FILE__).'/../batch/').'/*.php');
}
function changePrimarySymlink()
{
global $wwwroot;
passthru('rm '.$wwwroot.'/webservice');
passthru('ln -s '.realpath(dirname(__FILE__).'/../').' '.$wwwroot.'/webservice');
}