Exemple #1
0
}
if ($argv[1] == "--restart") {
    stopAllINstances();
    startInstances();
    die;
}
if ($argv[1] == "--start-instance") {
    startSingleInstance($argv[2]);
    die;
}
if ($argv[1] == "--stop-instance") {
    stopSingleInstance($argv[2]);
    die;
}
if ($argv[1] == "--reload-instance") {
    ReloadSingleInstance($argv[2]);
    die;
}
if ($argv[1] == "--restart-instance") {
    RestartSingleInstance($argv[2]);
    die;
}
if ($argv[1] == "--config-instance") {
    Buildconfig($argv[2]);
    die;
}
if ($argv[1] == "--single-status") {
    StatusInstance($argv[2]);
    die;
}
if ($argv[1] == "--all-status") {
Exemple #2
0
include_once(dirname(__FILE__) . '/ressources/class.maincf.multi.inc');


$_GET["LOGFILE"]="/usr/share/artica-postfix/ressources/logs/web/interface-postfix.log";
if(!is_file("/usr/share/artica-postfix/ressources/settings.inc")){shell_exec("/usr/share/artica-postfix/bin/process1 --force --verbose");}
if(preg_match("#--verbose#",implode(" ",$argv))){$GLOBALS["DEBUG"]=true;$GLOBALS["VERBOSE"]=true;}
if(preg_match("#--reload#",implode(" ",$argv))){$GLOBALS["RELOAD"]=true;}
if(preg_match("#--nowachdog#",implode(" ",$argv))){$GLOBALS["NOWATCHDOG"]=true;}
if(preg_match("#--noconf#",implode(" ",$argv))){$GLOBALS["NOWCONF"]=true;}

if($argv[1]=="--start"){startInstances();die();}
if($argv[1]=="--stop"){stopAllINstances();die();}
if($argv[1]=="--restart"){stopAllINstances();startInstances();die();}
if($argv[1]=="--start-instance"){startSingleInstance($argv[2]);die();}
if($argv[1]=="--stop-instance"){stopSingleInstance($argv[2]);die();}
if($argv[1]=="--reload-instance"){ReloadSingleInstance($argv[2]);die();}
if($argv[1]=="--restart-instance"){RestartSingleInstance($argv[2]);die();}
if($argv[1]=="--config-instance"){Buildconfig($argv[2]);die();}
if($argv[1]=="--single-status"){StatusInstance($argv[2]);die();}
if($argv[1]=="--all-status"){$GLOBALS["SILENT"]=true;StatusAllInstances($argv[2]);die();}

function startInstances(){
	checksConfigs();
	reset($GLOBALS["postfwd2_instances"]);
	@mkdir("/etc/postfwd2");
	
	while (list ($instance, $nth) = each ($GLOBALS["postfwd2_instances"]) ){
		if($GLOBALS["VERBOSE"]){echo "start: $instance\n";}
		startSingleInstance($instance);
	}