TFTP Service 1.0.7 (#1877)

* TFTP Service v1.0.7

Fixed linux and windows run as service issues
Fixed linux systemd service self install issues
Modified windows service self install process

* Revert "TFTP Service v1.0.7"

This reverts commit 4418ca7a11.

* TFTP Service v1.0.7

Fixed linux and windows run as service issues
Fixed linux systemd service self install issues
Modified windows service self install process
This commit is contained in:
minotaur01
2016-08-30 10:27:21 -04:00
committed by FusionPBX
parent 66f26cf2e6
commit 8b4eeaaf1a
3 changed files with 212 additions and 68 deletions

View File

@@ -30,7 +30,8 @@ require_once 'tftpserver.class.php';
class tftpservice extends TFTPServer
{
private $_debug=true;
private $_headless=true;
private $_debug=false;
private $_dbtype;
private $_dbhost;
private $_dbport;
@@ -42,6 +43,7 @@ class tftpservice extends TFTPServer
function __construct($server_url, $config)
{
parent::__construct($server_url);
if (isset($config['headless'])) $this->_headless=$config['headless'];
if (isset($config['debug'])) $this->_debug=$config['debug'];
if (isset($config['db_type'])) $this->_dbtype=$config['db_type'];
if (isset($config['db_host'])) $this->_dbhost=$config['db_host'];
@@ -57,12 +59,14 @@ class tftpservice extends TFTPServer
}
private function log($client, $level, $message) {
if($level!='D'||$this->_debug)
if(!$this->_headless && ($level!='D' || $this->_debug)) {
echo
date("H:i:s") . " " .
$level . " " .
$client . " " .
$message . "\n";
}
}
public function get($client, $filepath, $mode)