another test
[linksys-wrt3g-tools.git] / scripts / linksys-wrt3g.php
old mode 100644 (file)
new mode 100755 (executable)
index 1d1b9d2..520d6ba
@@ -1,3 +1,4 @@
+#!/usr/bin/env php
 <?php
 /**
 * Control script for Linksys WRT3g routers.
@@ -90,7 +91,11 @@ try {
 
     switch ($result->command_name) {
     case 'reboot':
-        $router->reboot();
+        $resp = $router->reboot();
+        echo $resp->getStatus() . ' ' . $resp->getReasonPhrase() . "\n";
+        if (intval($resp->getStatus() / 100) != 2) {
+            exit(3);
+        }
         break;
 
     case 'status':