Scripts d'installation - a tester
This commit is contained in:
parent
65a238acf1
commit
555efa630b
@ -35,6 +35,7 @@ environnement :
|
||||
$action = $argv[1];
|
||||
$mode = strtoupper($argv[2]);
|
||||
$hostname = exec('echo $(hostname)');
|
||||
$wwwroot = realpath(dirname(__FILE__).'/../../');
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
@ -47,7 +48,6 @@ switch ($action)
|
||||
echo "Ecriture de la configuration\n";
|
||||
writeConfig();
|
||||
//Création des liens symboliques
|
||||
require_once 'config.inc';
|
||||
echo "Création des liens symboliques\n";
|
||||
writeSymlinks();
|
||||
//Vérification du lien symbolique du projet
|
||||
@ -84,18 +84,21 @@ function isRoot()
|
||||
}
|
||||
|
||||
function changePermission(){
|
||||
|
||||
passthru('chown -R www-data: '.realpath(dirname(__FILE__).'/../'));
|
||||
}
|
||||
|
||||
function writeSymlinks(){
|
||||
if( !file_exists(PATH_SITE.'/data') ) {
|
||||
passthru('ln -vs '.realpath(dirname(__FILE__).'/../../data').' '.PATH_SITE.'/data');
|
||||
global $wwwroot;
|
||||
if( !file_exists($wwwroot.'/data') ) {
|
||||
passthru('ln -vs '.$wwwroot.'/data' . ' ' .
|
||||
realpath(dirname(__FILE__).'/../data'));
|
||||
}
|
||||
}
|
||||
|
||||
function writeConfig()
|
||||
{
|
||||
global $hostname;
|
||||
passthru('cp -v '.realpath(dirname(__FILE__)).'/'.$hostname.'/config.* '.realpath(dirname(__FILE__)).'/');
|
||||
passthru('cp -v '.realpath(dirname(__FILE__)).'/'.$hostname.'/config.php ' .
|
||||
realpath(dirname(__FILE__)).'/config.php');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user