PHP-Funktion:
function domain_check($domain) {
for($i = 0; $i <= 1; $i++) {
$file[$i] = rand();
system("./domaincheck.sh $domain $i $file[$i]");
$datei = fopen($file[$i],"r+");
$content = fgets($datei);
fclose($datei);
system("rm -r $file[$i]");
if($content != "") { return TRUE; }
}
return FALSE;
}
Bash-Script:
#! /bin/bash
if [ $2 -eq "0" ]; then
dig +short @194.77.253.129 $1 > ./$3
else
dig +short $1 > ./$3
fi
Das sind meine ersten Anfänge in Bash, also wehe es lacht einer