Changeset 52 for trunk/www/server.php


Ignore:
Timestamp:
Jun 20, 2009, 6:22:13 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Spuštěcí skript serverů start.sh spustí procesy emulátoru pouze pokud ještě nejsou spouštěné.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/server.php

    r48 r52  
    100100    $this->Task->Add('Start emulátoru', array(
    101101      'php www/shell.php ServerLock '.$this->Id,
    102       'screen -A -m -d -S server'.$this->Id.'-realmd emulator/'.$this->Server['Database']['Emulator']['Id'].'/bin/mangos-realmd -c server/'.$this->Id.'/etc/realmd.conf',
    103       'screen -A -m -d -S server'.$this->Id.'-worldd server/'.$this->Id.'/bin/start.sh',
     102      'server/'.$this->Id.'/bin/start.sh',
    104103      'php www/shell.php ServerUnLock '.$this->Id,
    105104    ));
     
    203202    // Start script
    204203    $ScriptFileName = '../server/'.$this->Id.'/bin/start.sh';
     204    $Content = array
     205    (
     206      '#!/bin/sh',
     207      'if [ -z `ps -ef | grep \'SCREEN -A -m -d -S server'.$this->Id.'-realmd\' | grep -v grep | awk \'{print $2}\'` ]',
     208      'then',
     209      'screen -A -m -d -S server'.$this->Id.'-realmd emulator/'.$this->Server['Database']['Emulator']['Id'].'/bin/mangos-realmd -c server/'.$this->Id.'/etc/realmd.conf',
     210      'fi',
     211      'if [ -z `ps -ef | grep \'SCREEN -A -m -d -S server'.$this->Id.'-worldd\' | grep -v grep | awk \'{print $2}\'` ]',
     212      'then',
     213      'screen -A -m -d -S server'.$this->Id.'-worldd server/'.$this->Id.'/bin/worldd_restarter.sh',
     214      'fi',
     215    );
     216    file_put_contents($ScriptFileName, implode("\n", $Content));
     217    chmod($ScriptFileName, 0777);   
     218
     219    $ScriptFileName = '../server/'.$this->Id.'/bin/worldd_restarter.sh';
    205220    $Content = array
    206221    (
Note: See TracChangeset for help on using the changeset viewer.