diff --git a/config/install.php b/config/install.php index 7b3267eb..1d18b657 100644 --- a/config/install.php +++ b/config/install.php @@ -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'); }