aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2010-12-28 22:59:02 +0100
committerChristian Weiske <cweiske@cweiske.de>2010-12-28 22:59:02 +0100
commit7f3b4f1a0dc8d49f225b405f2b4acd8e92e205c2 (patch)
treeedc4da0ff46574ba733bd2133a5da214e57bd9ca
parentcd3b46894c6f014735a7f278a60b9bd234a11ba0 (diff)
downloadlinksys-wrt3g-tools-7f3b4f1a0dc8d49f225b405f2b4acd8e92e205c2.tar.gz
linksys-wrt3g-tools-7f3b4f1a0dc8d49f225b405f2b4acd8e92e205c2.zip
load system config file; document config options
-rw-r--r--README18
-rw-r--r--Wrt3g/Config.php5
2 files changed, 23 insertions, 0 deletions
diff --git a/README b/README
index 741ddc1..7475c58 100644
--- a/README
+++ b/README
@@ -11,6 +11,24 @@ The routers are also known under the names:
- WRT54G3G
+Configuration
+-------------
+The tools can be configured in three ways:
+1. Commandline options
+ Use --help to get an overview
+
+2. User configuration file
+ ~/.config/linksys-wrt3g-tools
+
+3. System configuration file
+ /etc/linksys-wrt3g-tools
+
+The configuration files are normal ini-style files with key=value
+lines. Supported configuration options in the files are
+ - host
+ - user
+ - password
+
Dependencies
------------
diff --git a/Wrt3g/Config.php b/Wrt3g/Config.php
index f8b9649..a8232df 100644
--- a/Wrt3g/Config.php
+++ b/Wrt3g/Config.php
@@ -80,12 +80,17 @@ class Wrt3g_Config
*/
public function load($options = array())
{
+ //system config file
+ $this->loadFromFile('/etc/linksys-wrt3g-tools');
+
+ //user config file
$file = $this->getConfigFilePath();
if ($file) {
$this->loadFromFile($file);
}
$this->loadOptions($options);
+ //commandline options
if (isset($options['save'])) {
$this->save($file);
}