Mineplex/.FILES USED TO GET TO WHERE WE ARE PRESENTLY/xampp/install/portcheck.php
Daniel Waggner 76a7ae65df PUUUUUSH
2023-05-17 14:44:01 -07:00

35 lines
877 B
PHP

<?php
$host = "127.0.0.1";
$timeout = 1;
$i = 1;
$curdir = getcwd();
$curdir = getcwd();
list($partition, $nonpartition) = preg_split ("/:/", $curdir); //Fix by Wiedmann
$partwampp = substr(realpath(__FILE__), 0, strrpos(dirname(realpath(__FILE__)), '\\'));
$portchecklog = $partwampp."\install\\portcheck.ini";
$port = ereg_replace('-', '', $argv[1]);
$werte = substr_count($port, ',');
$ports = explode(',', $port);
$anzahl = count($ports);
$datei = fopen($portchecklog, 'w+');
fputs($datei, "[Ports]\r\n");
while ($i <= $anzahl) {
$a = $i - 1;
settype($ports[$a], "integer");
if (($handle = @fsockopen($host, $ports[$a], $errno, $errstr, $timeout)) == false) {
$print = "Port".$ports[$a]."=FREE\r\n";
} else {
$print = "Port".$ports[$a]."=BLOCKED\r\n";
}
fputs($datei, $print);
@fclose($handle);
$i++;
}
fclose($datei);
exit;
?>