aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2010-12-15 19:09:42 +0100
committerChristian Weiske <cweiske@cweiske.de>2010-12-15 19:09:42 +0100
commit2d190be44338e3674336943d366c739c55a273f5 (patch)
treecf2dffcd2587e0550252c864a7eb3aad1f4f26a0 /scripts
parentd4bb6e2400c09d7405d20df2967936952c31fbf4 (diff)
downloadlinksys-wrt3g-tools-2d190be44338e3674336943d366c739c55a273f5.tar.gz
linksys-wrt3g-tools-2d190be44338e3674336943d366c739c55a273f5.zip
add card status command
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/linksys-wrt3g.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/scripts/linksys-wrt3g.php b/scripts/linksys-wrt3g.php
index e9279e3..f475025 100755
--- a/scripts/linksys-wrt3g.php
+++ b/scripts/linksys-wrt3g.php
@@ -72,13 +72,22 @@ $parser->addOption(
)
);
-$parser->addCommand(
+$stCmd = $parser->addCommand(
'status',
array(
'aliases' => array('s', 'st'),
'description' => 'Show the router status'
)
);
+$stCmd = $parser->addCommand(
+ 'cardstatus',
+ array(
+ 'aliases' => array('c', 'cs'),
+ 'description' => 'Show the card/SIM status'
+ )
+);
+
+
$parser->addCommand(
'reboot',
array(
@@ -101,6 +110,8 @@ try {
$router->user = $result->options['user'];
$router->password = $result->options['password'];
+ $router->log('Command: ' . $result->command_name, 2);
+
switch ($result->command_name) {
case 'reboot':
$resp = $router->reboot();
@@ -110,9 +121,14 @@ try {
}
break;
+ case 'cardstatus':
case 'status':
default:
- $arStatus = $router->getStatus();
+ if ($result->command_name == 'cardstatus') {
+ $arStatus = $router->getCardStatus();
+ } else {
+ $arStatus = $router->getStatus();
+ }
foreach ($arStatus as $key => $value) {
echo $key . ': ' . $value . "\n";
}