Exemplo n.º 1
0
 static function rebootRtorrent($login)
 {
     $sortie = MakerRtorrentLancer::stop($login);
     if ($sortie[0] !== 0) {
         throw new \Exception("Impossible d'arrêté rtorrent");
     }
     do {
         $sortie = \model\simple\Console::execute('su ' . escapeshellarg($login) . ' -c "tmux list-sessions"');
         if ($sortie[0] !== 1) {
             \model\simple\Console::println("Rtorrent est encore en exécution");
             sleep(10);
         }
     } while ($sortie[0] !== 1);
     $sortie = MakerRtorrentLancer::start($login);
     if ($sortie[0] !== 0) {
         throw new \Exception("Impossible de lancer rtorrent");
     }
 }