示例#1
0
文件: Server.php 项目: kingsj/core
 private function wait_for_ssh($options)
 {
     $ls = new RemoteCommand('ls > /dev/null', $options);
     $code = $ls->execute(true);
     while ($code != 0) {
         sleep(2);
         $code = $ls->execute(true);
     }
 }
示例#2
0
 * Twitter: @_nadnerb
 *
 * Farbtastic: http://acko.net/blog/farbtastic-jquery-color-picker-plug-in/
 */
include 'colourPicker/lib/RemoteCommand.class.php';
include 'colourPicker/conf/Configuration.php';
session_start();
session_destroy();
session_start();
if (empty($_SESSION)) {
    $_SESSION['priority'] = array();
    $_SESSION['colour'] = '00FFFF';
    $_SESSION['duration'] = -1;
}
$messages = array();
$com = new RemoteCommand();
if (isset($_POST['submit'])) {
    switch ($_POST['submit']) {
        case 'Turn On':
            $return = $com->withServer($config['serverAddress'], $config['serverUsername'], $config['serverPassword'], $config['debug'])->withController($config['serverController'])->withSleep(2)->callOn();
            if ($return) {
                $messages[] = array('type' => 'success', 'content' => 'Turned on Hyperion successfully.');
            }
            break;
        case 'Turn Off':
            $return = $com->withServer($config['serverAddress'], $config['serverUsername'], $config['serverPassword'], $config['debug'])->withController($config['serverController'])->withSleep(1)->callOff();
            if ($return) {
                $messages[] = array('type' => 'success', 'content' => 'Turned off Hyperion successfully.');
            }
            break;
        case 'Clear':