예제 #1
0
 }
 function client_connect($ip, $port)
 {
     $sockfd = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
     if (!$sockfd) {
         error($sockfd, __LINE__, __FILE__);
         return FALSE;
     }
     $result = socket_connect($sockfd, $ip, $port);
     if (!$result) {
         error($sockfd, __LINE__, __FILE__);
         return FALSE;
     }
     return $sockfd;
 }
 $sockfd = client_connect($ip, $port);
 if (!$sockfd) {
     exit(0);
 }
 if (!socket_write($sockfd, $str, strlen($str))) {
     echo "<p>The server has been closed!</p>";
     //echo "socket_write()failed: reason:".socket_strerror($sockfd)."\n";
 } else {
     //接收服务器信息
     if (!($output = socket_read($sockfd, 1024))) {
         echo "<p>No DATA</p>";
     } else {
         ?>
         <script language="JavaScript">
          alert("插入成功!");
           window.location.href="../frame/monitorkey.php";
예제 #2
0
if($argv[1]=="--server-stop"){StopServer();die();}
if($argv[1]=="--default-eth"){OpenVpnClientGetDefaultethLink();die();}
if($argv[1]=="--ipof"){echo GetIpaddrOf($argv[2])."\n";die();}
if($argv[1]=="--bridges"){print_r(GetBridgeExists($argv[2]))."\n";die();}
if($argv[1]=="--fix-routes"){BuildClientRoute($argv[2])."\n";die();}
if($argv[1]=="--schedule"){ServerScheduledTTL()."\n";die();}
if($argv[1]=="--windows-client"){windows_client($argv[2])."\n";die();}
if($argv[1]=="--argvs"){LoadArgvs()."\n";die();}
if($argv[1]=="--wakeup-server"){wakeup_server_mode()."\n";die();}
if($argv[1]=="--wakeup-clients"){wakeup_client_mode()."\n";die();}
if($argv[1]=="--remove-clients"){remove_client($argv[2])."\n";die();}



if($argv[1]=="--client-connect"){client_connect($argv)."\n";die(0);}



if($argv[1]=="--client-restart"){
	StopOpenVPNCLients();
	StartOPenVPNCLients();
	die();
}

writelogs("Starting......: OpenVPN Unable to understand this command-line (" .implode(" ",$argv).")","main",__FILE__,__LINE__);	
	
	

function BuildIpTablesServer(){
	iptables_delete_rules();
예제 #3
0
    die;
}
if ($argv[1] == "--wakeup-server") {
    wakeup_server_mode() . "\n";
    die;
}
if ($argv[1] == "--wakeup-clients") {
    wakeup_client_mode() . "\n";
    die;
}
if ($argv[1] == "--remove-clients") {
    remove_client($argv[2]) . "\n";
    die;
}
if ($argv[1] == "--client-connect") {
    client_connect($argv) . "\n";
    die(0);
}
if ($argv[1] == "--client-restart") {
    StopOpenVPNCLients();
    StartOPenVPNCLients();
    die;
}
writelogs("Starting......: " . date("H:i:s") . " OpenVPN Unable to understand this command-line (" . implode(" ", $argv) . ")", "main", __FILE__, __LINE__);
function BuildIpTablesServer()
{
    if ($GLOBALS["WAIT"]) {
        sleep(5);
    }
    iptables_delete_rules();
    $IPTABLES_ETH = $GLOBALS["IPTABLES_ETH"];