| @@ 336-351 (lines=16) @@ | ||
| 333 | $conn->exec($screenCmd); |
|
| 334 | } |
|
| 335 | ||
| 336 | public function removeFromServer() |
|
| 337 | { |
|
| 338 | $screenName = $this->getScreenName(); |
|
| 339 | $serverDir = $this->getAbsoluteDir(); |
|
| 340 | $scriptPath = $serverDir . 'minecraft.sh'; |
|
| 341 | ||
| 342 | $conn = $this->getMachine()->getConnection(); |
|
| 343 | ||
| 344 | // On commence par vérifier que le serveur n'est pas lancé (sinon on l'arrête) |
|
| 345 | $pgrep = '`ps aux | grep SCREEN | grep "' . $screenName . ' " | grep -v grep | wc -l`'; |
|
| 346 | $stopCmd = 'if [ ' . $pgrep . ' != "0" ]; then ' . $scriptPath . ' stop; fi;'; |
|
| 347 | $conn->exec($stopCmd); |
|
| 348 | ||
| 349 | // Puis on supprime complètement le dossier du serveur |
|
| 350 | return $conn->remove($serverDir); |
|
| 351 | } |
|
| 352 | ||
| 353 | public function removeInstallationFiles() |
|
| 354 | { |
|
| @@ 561-578 (lines=18) @@ | ||
| 558 | return $this->getAbsoluteBinDir() . $this->getGame()->getCfgPath(); |
|
| 559 | } |
|
| 560 | ||
| 561 | public function removeFromServer() |
|
| 562 | { |
|
| 563 | $screenName = $this->getScreenName(); |
|
| 564 | $scriptPath = $this->getAbsoluteHldsScriptPath(); |
|
| 565 | $serverPath = $this->getAbsoluteDir(); |
|
| 566 | ||
| 567 | $conn = $this->getMachine()->getConnection(); |
|
| 568 | ||
| 569 | // On commence par vérifier que le serveur n'est pas lancé (sinon on l'arrête) |
|
| 570 | $pgrep = '`ps aux | grep SCREEN | grep "' . $screenName . ' " | grep -v grep | wc -l`'; |
|
| 571 | $stopCmd = 'if [ ' . $pgrep . ' != "0" ]; then ' . $scriptPath . ' stop; fi; '; |
|
| 572 | $conn->exec($stopCmd); |
|
| 573 | ||
| 574 | // Puis on supprime complètement le dossier du serveur |
|
| 575 | $delCmd = 'rm -Rf ' . $serverPath; |
|
| 576 | ||
| 577 | return $conn->exec($delCmd); |
|
| 578 | } |
|
| 579 | ||
| 580 | public function modifyGameModesCfg() |
|
| 581 | { |
|