You can simply cat the existing file to see the results of what it needs to have for each whitelisted entry
I'm not sure what you mean; I don't have SSH access with a dynamic IP, either.. hence the need for a script.
I tried something like this:
Code:
$usrip = isset($_SERVER['REMOTE_ADDR']) ? preg_replace("/[^0-9.]/", "", $_SERVER['REMOTE_ADDR']) : '';
$file = "/etc/hosts.allow";
$fp = fopen($file, "w") or die("can't open hosts.allow file");
$stringData = "whostmgrd : '.$usrip.' : allow\n";
fwrite($fh, $stringData);
$stringData = "#work\n";
fwrite($fh, $stringData);
fclose($fh);
}
and I get the following error:
Warning: fopen(/etc/hosts.allow) [function.fopen]: failed to open stream: Permission denied in /home/site/public_html/adminurl/ip.php on line 44
can't open hosts.allow file
So I tried to chmod ip.php to user nobody, same result.
Any tips?