set exit code when rebooting failed
authorChristian Weiske <cweiske@cweiske.de>
Fri, 10 Dec 2010 17:35:14 +0000 (18:35 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 10 Dec 2010 17:35:14 +0000 (18:35 +0100)
scripts/linksys-wrt3g.php

index ef18708..48683e7 100644 (file)
@@ -92,6 +92,9 @@ try {
     case 'reboot':
         $resp = $router->reboot();
         echo $resp->getStatus() . ' ' . $resp->getReasonPhrase() . "\n";
+        if (intval($resp->getStatus() / 100) != 2) {
+            exit(3);
+        }
         break;
 
     case 'status':