From d72cd13a1364139c2e60e774fb4d5bed0be1fcc6 Mon Sep 17 00:00:00 2001 From: neersighted Date: Wed, 29 Feb 2012 19:12:30 -0800 Subject: [PATCH] added message to ping --- plugins/ping.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/ping.py b/plugins/ping.py index 5637cee..f5386ee 100644 --- a/plugins/ping.py +++ b/plugins/ping.py @@ -5,12 +5,12 @@ import re @hook.command -def ping(inp): +def ping(inp, reply=None): ".ping [count] -- Pings [count] times." args = inp.split(' ') host = args[0] - + if len(args) > 1: count = args[1] count = int(count) @@ -21,6 +21,8 @@ def ping(inp): count = str(count) + reply("Attempting to ping %s %s times..." % (host, count)) + pingcmd = subprocess.check_output("ping -c "\ + count + " " + host, shell=True) if 'request timed out' in pingcmd or 'unknown host' in pingcmd: