#!/usr/bin/env php
<?php 
/**
 * Assumes to run in a SilverStripe webroot
 */
require_once 'lib.php';
$opts = getopt('', array('if-env:', 'username:'******'access-key:', 'tunnel-identifier:', 'base-url:'));
// --if-env=BEHAT_TEST means that this script will only be executed if the given environment var is set
if (!checkenv(@$opts['if-env'])) {
    echo "Apache skipped; {$opts['if-env']} wasn't set.\n";
    exit(0);
}
echo "Starting Sauce Connect...\n";
// Download Sauce Connect
$connectURL = "http://saucelabs.com/downloads/Sauce-Connect-latest.zip";
$connectDir = "/tmp/sauce-connect-" . rand(100000, 999999);
$connectDownload = $connectDir . "/Sauce_Connect.zip";
$readyFile = $connectDir . "/connect-ready-" . rand(100000, 999999);
$CLI_connectURL = escapeshellarg($connectURL);
$CLI_connectDir = escapeshellarg($connectDir);
$CLI_connectDownload = escapeshellarg($connectDownload);
$CLI_readyFile = escapeshellarg($readyFile);
mkdir($connectDir, 0777, true);
// Download sauce connect if not already downloaded
if (!file_exists("Sauce-Connect.jar")) {
    run("curl {$CLI_connectURL} > {$CLI_connectDownload}");
    run("unzip {$CLI_connectDownload}");
    run("rm {$CLI_connectDownload}");
}
// Start Sauce Connect
run("java -jar Sauce-Connect.jar --readyfile {$CLI_readyFile} --tunnel-identifier {$opts['tunnel-identifier']}" . " {$opts['username']} {$opts['access-key']} > /dev/null &");
Пример #2
0
            $bg4 = BG_2;
        }
        if ($ds['game'] == "CS") {
            $game = "HL";
        } else {
            $game = $ds['game'];
        }
        $showgame = getgamename($ds['game']);
        $serverdata = explode(":", $ds['ip']);
        $ip = $serverdata[0];
        if (isset($serverdata[1])) {
            $port = $serverdata[1];
        } else {
            $port = '';
        }
        if (!checkenv('disable_functions', 'fsockopen')) {
            if (!fsockopen("udp://" . $ip, $port, $strErrNo, $strErrStr, 30)) {
                $status = "<i>" . $_language->module['timeout'] . "</i>";
            } else {
                $status = "<b>" . $_language->module['online'] . "</b>";
            }
        } else {
            $status = "<i>" . $_language->module['not_supported'] . "</i>";
        }
        $servername = htmloutput($ds['name']);
        $info = htmloutput($ds['info']);
        eval("\$server = \"" . gettemplate("server") . "\";");
        echo $server;
        $i++;
    }
} else {