Complement script d'installation
This commit is contained in:
parent
eb6673ac4a
commit
2a4eb8454d
@ -10,17 +10,13 @@ Avec les options --help, -help, -h, et -?, vous obtiendrez cette aide.
|
|||||||
Utilisation : <?php echo $argv[0]; ?> [action]
|
Utilisation : <?php echo $argv[0]; ?> [action]
|
||||||
|
|
||||||
action :
|
action :
|
||||||
- install : Création de la configuration et des modifications nécessaire sur les fichiers
|
- configure : Configuration
|
||||||
|
- install : Configuration, Switch entre version
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isRoot()) {
|
|
||||||
echo 'Vous devez être ROOT pour utiliser ce script';
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$action = $argv[1];
|
$action = $argv[1];
|
||||||
$mode = strtoupper($argv[2]);
|
$mode = strtoupper($argv[2]);
|
||||||
$hostname = exec('echo $(hostname)');
|
$hostname = exec('echo $(hostname)');
|
||||||
@ -28,13 +24,20 @@ $wwwroot = realpath(dirname(__FILE__).'/../../');
|
|||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'install':
|
case 'configure':
|
||||||
writeConfig();
|
writeConfig();
|
||||||
changePermission();
|
changePermission();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'genwsdl':
|
case 'install':
|
||||||
|
if (!isRoot()) {
|
||||||
|
echo "Vous devez être ROOT pour utiliser ce script.\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
writeConfig();
|
||||||
|
changePermission();
|
||||||
|
changePrimarySymlink();
|
||||||
|
passthru('php ../batch/genwsdl.php all');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,11 +54,18 @@ function isRoot()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changePermission(){
|
function changePermission()
|
||||||
|
{
|
||||||
passthru('chown -R www-data: '.realpath(dirname(__FILE__).'/../'));
|
passthru('chown -R www-data: '.realpath(dirname(__FILE__).'/../'));
|
||||||
passthru('chmod +x '.realpath(dirname(__FILE__).'/../batch/*.php'));
|
passthru('chmod +x '.realpath(dirname(__FILE__).'/../batch/*.php'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changePrimarySymlink()
|
||||||
|
{
|
||||||
|
passthru('rm '.$wwwroot.'/webservice');
|
||||||
|
passthru('ln -s '.realpath(dirname(__FILE__).'/../').' '.$wwwroot.'/webservice');
|
||||||
|
}
|
||||||
|
|
||||||
function writeConfig()
|
function writeConfig()
|
||||||
{
|
{
|
||||||
global $hostname;
|
global $hostname;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user