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 6b12ac5c7b7fac167876c8d1fc1c8c645ea7547d..c0ee3b00e2779e72de68c0b2ec9b9b0b6f9dbcd3 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 cf7892f9459f09c90fc3236cc92f4e58f7ad366c..5fc252601cafc832b45799954cc4a19e35a6b55e 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();