git.cweiske.de
/
linksys-wrt3g-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix error
[linksys-wrt3g-tools.git]
/
scripts
/
linksys-wrt3g.php
diff --git
a/scripts/linksys-wrt3g.php
b/scripts/linksys-wrt3g.php
index e9279e3d464b0317071c10d77a7a99669acf55e8..7d87cd1decf30104be0ec3728cc7745c71b0bd39 100755
(executable)
--- a/
scripts/linksys-wrt3g.php
+++ b/
scripts/linksys-wrt3g.php
@@
-72,13
+72,29
@@
$parser->addOption(
)
);
)
);
-$parser->addCommand(
+$
stCmd = $
parser->addCommand(
'status',
array(
'aliases' => array('s', 'st'),
'status',
array(
'aliases' => array('s', 'st'),
- 'description' => 'Show the router status'
+ 'description' => 'Show the connection status'
+ )
+);
+$stCmd = $parser->addCommand(
+ 'cardstatus',
+ array(
+ 'aliases' => array('c', 'cs'),
+ 'description' => 'Show the card/SIM status'
)
);
)
);
+$stCmd = $parser->addCommand(
+ 'allstatus',
+ array(
+ 'aliases' => array('a', 'as'),
+ 'description' => 'Show all status details'
+ )
+);
+
+
$parser->addCommand(
'reboot',
array(
$parser->addCommand(
'reboot',
array(
@@
-101,6
+117,8
@@
try {
$router->user = $result->options['user'];
$router->password = $result->options['password'];
$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();
switch ($result->command_name) {
case 'reboot':
$resp = $router->reboot();
@@
-110,9
+128,17
@@
try {
}
break;
}
break;
+ case 'allstatus':
+ case 'cardstatus':
case 'status':
default:
case 'status':
default:
- $arStatus = $router->getStatus();
+ if ($result->command_name == 'allstatus') {
+ $arStatus = $router->getFullStatus();
+ } else if ($result->command_name == 'cardstatus') {
+ $arStatus = $router->getCardStatus();
+ } else {
+ $arStatus = $router->getConnectionStatus();
+ }
foreach ($arStatus as $key => $value) {
echo $key . ': ' . $value . "\n";
}
foreach ($arStatus as $key => $value) {
echo $key . ': ' . $value . "\n";
}