-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
25 lines (21 loc) · 700 Bytes
/
index.php
File metadata and controls
25 lines (21 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
use DynDNS\DynDNS;
set_include_path(get_include_path() . PATH_SEPARATOR . 'PEAR' . DIRECTORY_SEPARATOR);
require_once 'DynDNS/DynDNS.php';
require_once 'PEAR/Net/DNS2.php';
// Load configuration
$config = array();
include_once 'config/config.php';
if (php_sapi_name() === 'cli') {
// Create password hash on CLI usage
if ($_SERVER['argc'] === 2) {
echo 'Your password hash is:'."\n";
echo DynDNS::passwordHash($_SERVER['argv'][1])."\n";
} else {
echo 'Create password hash for config using'."\n\n";
echo $_SERVER['_'].' '.$_SERVER['argv'][0].' PASSWORD'."\n";
}
} else {
// Start DynDNS server client
$dyndns = new DynDNS($config);
}