Search
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
pfSense
All Projects
pfSense
Overview
Activity
Roadmap
Issues
Download (845 Bytes)
Bug #7206
» r53-dyndns-clean.php
Jason McCormick
, 03/02/2017 07:58 PM
<?php
include_once
(
"r53.class"
);
function
log_error
(
$l
){
printf
(
"LOG: %s
\n
"
,
$l
);
return
true
;
}
main
:
# Pass this your public and private keys
$r53
=
new
Route53
(
"PUBKEY"
,
"PRIVKEY"
);
$apiurl
=
$r53
->
getApiUrl
(
"ZONEID"
);
$xmlreq
=
$r53
->
getRequestBody
(
"domain.example.com"
,
"8.8.8.8"
,
"3600"
);
log_error
(
sprintf
(
"XMLHASH:%s"
,
hash
(
"sha256"
,
$xmlreq
)));
$httphead
=
$r53
->
getHttpPostHeaders
(
"ZONEID"
,
"us-east-1"
,
hash
(
"sha256"
,
$xmlreq
));
if
(
true
){
log_error
(
sprintf
(
"Sending reuquest to: %s"
,
$apiurl
));
foreach
(
$httphead
as
$hv
){
log_error
(
sprintf
(
"Header: %s"
,
$hv
));
}
log_error
(
sprintf
(
"XMLPOST: %s"
,
$xmlreq
));
}
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
$apiurl
);
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
$httphead
);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$xmlreq
);
print
curl_exec
(
$ch
);
print
"
\n
"
;
curl_close
(
$ch
);
?>
« Previous
1
2
Next »
(2-2/2)
Loading...