mirror of
https://github.com/fernwerker/ownDynDNS.git
synced 2025-07-10 06:05:13 +02:00
minimum improvements on major refoctoring of b2un0:
- updated README.md to new filenames - added log.json creation if not existent in Handler.php
This commit is contained in:
parent
b551a25391
commit
eb34f44292
2 changed files with 9 additions and 3 deletions
|
@ -26,8 +26,8 @@ Self-hosted dynamic DNS php script to update netcup DNS API from Router like AVM
|
||||||
* only the url needs to be adjusted, the rest is automatically filled by your AVM FRITZ!Box
|
* only the url needs to be adjusted, the rest is automatically filled by your AVM FRITZ!Box
|
||||||
* http or https is possible if valid SSL certificate (e.g. Let's Encrypt)
|
* http or https is possible if valid SSL certificate (e.g. Let's Encrypt)
|
||||||
* Domainname: `<host record that is supposed to be updated>`
|
* Domainname: `<host record that is supposed to be updated>`
|
||||||
* Username: `<username as defined in update.php>`
|
* Username: `<username as defined in .env file>`
|
||||||
* Password: `<password as definied in update.php>`
|
* Password: `<password as definied in .env file>`
|
||||||
|
|
||||||
# run as cronjob on a **nix based device
|
# run as cronjob on a **nix based device
|
||||||
* see [examples](./examples)
|
* see [examples](./examples)
|
||||||
|
@ -38,4 +38,4 @@ Self-hosted dynamic DNS php script to update netcup DNS API from Router like AVM
|
||||||
|
|
||||||
## License
|
## License
|
||||||
Published under GNU General Public License v3.0
|
Published under GNU General Public License v3.0
|
||||||
© Felix Kretschmer, 2018
|
© Felix Kretschmer, 2019
|
||||||
|
|
|
@ -75,6 +75,12 @@ final class Handler
|
||||||
if (!$this->config->isLog()) {
|
if (!$this->config->isLog()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!file_exists($this->config->getLogFile())) {
|
||||||
|
if (!touch($this->config->getLogFile())) {
|
||||||
|
printf('[ERROR] unable to create %s %s', $this->config->getLogFile(), PHP_EOL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// save only the newest 100 log entries for each domain
|
// save only the newest 100 log entries for each domain
|
||||||
$this->log[$this->payload->getDomain()] = array_reverse(array_slice(array_reverse($this->log[$this->payload->getDomain()]), 0, 100));
|
$this->log[$this->payload->getDomain()] = array_reverse(array_slice(array_reverse($this->log[$this->payload->getDomain()]), 0, 100));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue