[ previous ] [ next ] [ threads ]
 
 From:  "Ramon A. Darrow" <rdarrow at worrad dot com>
 To:  "Noli Rafallo" <admin at data dot mydestiny dot net>, <m0n0wall at lists dot m0n0 dot ch>
 Subject:  RE: [m0n0wall] RE: Running command line PHP script
 Date:  Sat, 18 Mar 2006 23:55:19 -0600
Yes, I just tried it but don't seem to get any result, positive or
negative.  It just spits out the following output:
$ #!/usr/local/bin/php -q /tmp/everydns-update.php

If it successfully runs the script it should output the text we received
back from everydns.

 

-----Original Message-----
From: Noli Rafallo [mailto:admin at data dot mydestiny dot net] 
Sent: Saturday, March 18, 2006 11:38 PM
To: Ramon A. Darrow; m0n0wall at lists dot m0n0 dot ch
Subject: RE: [m0n0wall] RE: Running command line PHP script

Did you try this #!/usr/local/bin/php -q


-----Original Message-----
From: Ramon A. Darrow [mailto:rdarrow at worrad dot com]
Sent: Sunday, March 19, 2006 12:32 PM
To: m0n0wall at lists dot m0n0 dot ch
Subject: [m0n0wall] RE: Running command line PHP script

> Let's see your PHP script /tmp/everydns-update.php

This is what is in /tmp/everydns-update.php:

#!/usr/local/bin/php
<?php
$username = '**************';
$password = '**************';
$domain = '**************';

$auth = base64_encode("$username:$password");

$targethost = 'dyn.everydns.net';
$targetport = 80;
$version = '0.1';
$path = "/index.php?ver=$version&domain=$domain";

$timeout = 30;

$fp = fsockopen($targethost, $targetport, $errno, $errstr, $timeout); if
(!$fp) {
	echo "$errstr ($errno)<br />\n";
} else {
	$out = "GET $path HTTP/1.0\r\n";
	$out .= "User-Agent: everydns-update.php $version\r\n";
	$out .= "Host: $targethost\r\n";
	$out .= "Authorization: Basic $auth\r\n\r\n";

	echo $out;

	fwrite($fp, $out);
	while (!feof($fp)) {
		echo fgets($fp, 128);
	}
	fclose($fp);
}
?>

---------------------------------------------------------------------
To unsubscribe, e-mail: m0n0wall dash unsubscribe at lists dot m0n0 dot ch
For additional commands, e-mail: m0n0wall dash help at lists dot m0n0 dot ch