use new config for munin script
authorChristian Weiske <cweiske@cweiske.de>
Tue, 28 Dec 2010 20:57:52 +0000 (21:57 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 28 Dec 2010 20:57:52 +0000 (21:57 +0100)
Wrt3g.php
scripts/munin.php

index 6b12ac5..c0ee3b0 100644 (file)
--- a/Wrt3g.php
+++ b/Wrt3g.php
@@ -63,7 +63,7 @@ class Wrt3g
      *
      * @see Wrt3g_Config
      */
-    public function loadConfig($options)
+    public function loadConfig($options = array())
     {
         $this->config = new Wrt3g_Config($this);
         $this->config->load($options);
index cf7892f..5fc2526 100755 (executable)
@@ -11,7 +11,6 @@
 * @license  AGPL v3
 * @link     http://cweiske.de/linksys-wrt3g-tools.htm
 */
-require_once dirname(__FILE__) . '/../config.php';
 require_once 'Wrt3g.php';
 
 if (isset($argv[1]) && $argv[1] == 'autoconf') {
@@ -50,9 +49,7 @@ TXT;
 
 try {
     $router = new Wrt3g();
-    $router->host     = $GLOBALS['linksys-wrt3g-tools']['host'];
-    $router->user     = $GLOBALS['linksys-wrt3g-tools']['user'];
-    $router->password = $GLOBALS['linksys-wrt3g-tools']['password'];
+    $router->loadConfig();
 
     $arStatus = $router->getConnectionStatus();