From 12be21fb4efbe141554e6f202dda036418f3c443 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 23 Nov 2017 18:45:18 +0000 Subject: [PATCH] Implement removing servers and rename some commands --- help.json | 3 ++- pool.json | 1 + threshold | 18 ++++++++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/help.json b/help.json index a470e49..ef6f7a5 100644 --- a/help.json +++ b/help.json @@ -1,7 +1,8 @@ { "pass": "pass [password]", "logout": "logout", - "connect": "connect [name] [address] [port] [ssl|plain] [nickname]", + "add": "add [name] [address] [port] [ssl|plain] [nickname]", + "del": "del [name", "list": "list", "rehash": "rehash" } diff --git a/pool.json b/pool.json index e69de29..9e26dfe 100644 --- a/pool.json +++ b/pool.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/threshold b/threshold index 19c24ef..08e83a4 100755 --- a/threshold +++ b/threshold @@ -171,7 +171,7 @@ class Helper(object): info("\n".join(poolMap)) return - elif cmd == "connect": + elif cmd == "add": if length == 6: if spl[1] in pool.keys(): @@ -193,7 +193,21 @@ class Helper(object): self.savePool() return else: - incUsage("connect") + incUsage("add") + return + + elif cmd == "del": + if length == 2: + + if not spl[1] in pool.keys(): + failure("Name does not exist: %s" % spl[1]) + return + del pool[spl[1]] + success("Successfully removed bot") + self.savePool() + return + else: + incUsage("del") return else: