Browse Source

handle shutdown command in bob

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@569 e5f2f494-b856-4b98-b285-d166d9295462
Jelte Jansen 15 years ago
parent
commit
fe46dcc175
2 changed files with 15 additions and 1 deletions
  1. 10 1
      src/bin/bind10/bind10.py
  2. 5 0
      src/bin/bind10/bob.spec

+ 10 - 1
src/bin/bind10/bind10.py

@@ -98,7 +98,16 @@ class BoB:
         if self.verbose:
             print("[XX] Boss got command:")
             print(command)
-        return None
+        answer = None
+        if "command" in command:
+            cmd = command["command"]
+            if cmd == "shutdown":
+                self.shutdown()
+            else:
+                answer = { "result": [ 1, "unknown command: " + cmd ] }
+        else:
+            answer = { "result": [ 1, "bad command" ] }
+        return answer
     
     def startup(self):
         """Start the BoB instance.

+ 5 - 0
src/bin/bind10/bob.spec

@@ -19,6 +19,11 @@
           "item_optional": False,
           "item_default": ""
         } ]
+      },
+      {
+        "command_name": "shutdown",
+        "command_description": "Shut down BIND 10",
+        "command_args": []
       }
     ]
   }