From 0d43078be4af8db084ac3dc2e70903329ffb9299 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Fri, 20 May 2016 12:16:33 +0000 Subject: [PATCH] creating setup-routine to run basic configuration in browser. Reorganized some config-constants --- .gitignore | 1 + README.md | 3 +- config/config.php | 92 ---------------------------------- include/functions.php | 6 +-- include/sysinfo.php | 4 +- include/tools.php | 17 +++++++ index.php | 1 + linux-step-by-step.md | 2 +- setup.php | 111 ++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 138 insertions(+), 99 deletions(-) delete mode 100644 config/config.php create mode 100644 setup.php diff --git a/.gitignore b/.gitignore index c6e887e..65f4c09 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ Links.txt +config/config.php \ No newline at end of file diff --git a/README.md b/README.md index 782d729..a1f6dd6 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ Installation ============ * Please ensure to not put loglevels at 0 in MMDVM.ini. * Copy all files into your webroot and enjoy working with it. -* Edit config.php located in /config-folder in your web-folder. +* Create a config/config.php by calling setup.php and giving suitable values +* If Dashboard is working, remove setup.php from your webroot For detailled installation see `linux-step-by-step.md` within this repository. diff --git a/config/config.php b/config/config.php deleted file mode 100644 index 5ff516b..0000000 --- a/config/config.php +++ /dev/null @@ -1,92 +0,0 @@ - \ No newline at end of file diff --git a/include/functions.php b/include/functions.php index 6d860e4..03e0e6d 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2,7 +2,7 @@ function getMMDVMHostVersion() { // returns creation-time of MMDVMHost as version-number - $filename = MMDVMHOSTPATH . "MMDVMHost"; + $filename = MMDVMHOSTPATH."/MMDVMHost"; exec($filename." -v 2>&1", $output); if (!startsWith(substr($output[0],18,8),"20")) { return getMMDVMHostFileVersion(); @@ -13,7 +13,7 @@ function getMMDVMHostVersion() { function getMMDVMHostFileVersion() { // returns creation-time of MMDVMHost as version-number - $filename = MMDVMHOSTPATH . "MMDVMHost"; + $filename = MMDVMHOSTPATH."/MMDVMHost"; if (file_exists($filename)) { return date("d M y", filectime($filename)); } @@ -85,7 +85,7 @@ function showMode($mode, $mmdvmconfigs) { function getLog() { // Open Logfile and copy loglines into LogLines-Array() $logLines = array(); - if ($log = fopen(MMDVMLOGFILE,'r')) { + if ($log = fopen(MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log", 'r')) { while ($logLine = fgets($log)) { if (!strpos($logLine, "Debug") && !strpos($logLine,"Received a NAK")) { array_push($logLines, $logLine); diff --git a/include/sysinfo.php b/include/sysinfo.php index 33bbafa..0d8d75a 100644 --- a/include/sysinfo.php +++ b/include/sysinfo.php @@ -2,7 +2,7 @@ exec("cat /sys/class/thermal/thermal_zone0/temp", $cputemp); exec("cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", $cpufreq); $cputemp = $cputemp[0] / 1000; - if (TEMPERATUREALERT && $cputemp > TEMPERATUREHIGHLEVEL) { + if (defined("TEMPERATUREALERT") && $cputemp > TEMPERATUREHIGHLEVEL) { ?> + + + + + + + MMDVM-Dashboard by DG9VH - Setup + + +\n"); + fclose($configfile); +?> + + + +
+ +
+

MMDVMHost-Configuration

+
+ Path to MMDVMHost-logfile + +
+
+ Logfile-prefix + +
+
+ Path to MMDVM.ini + +
+
+ MMDVM.ini-filename + +
+
+ Path to MMDVMHost-executable + +
+
+
+

ircddbgateway-Configuration

+
+ Path to Links.log + +
+
+ Name of ircddbgateway-executeable + +
+
+
+

Global Configuration

+
+ Refresh page after in seconds + +
+
+ Show progressbars +
+
+
+ Enable CPU-temperature-warning +
+
+
+ Warning temperature + +
+
+ Last heard list lines: + +
+
+ + + +
+
+
+ + +