Added Windows catch
This commit is contained in:
parent
7b21ffe065
commit
17a4d8262c
1 changed files with 5 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
from util import hook
|
||||
import subprocess
|
||||
import re
|
||||
import os
|
||||
|
||||
ping_regex = re.compile(r"(\d+.\d+)/(\d+.\d+)/(\d+.\d+)/(\d+.\d+)")
|
||||
|
||||
|
@ -9,10 +10,14 @@ ping_regex = re.compile(r"(\d+.\d+)/(\d+.\d+)/(\d+.\d+)/(\d+.\d+)")
|
|||
@hook.command
|
||||
def ping(inp, reply=None):
|
||||
".ping <host> [count] -- Pings <host> [count] times."
|
||||
|
||||
if os.name == "nt":
|
||||
return "Sorry, this command is not supported on Windows systems."
|
||||
|
||||
args = inp.split(' ')
|
||||
host = args[0]
|
||||
|
||||
# check for a seccond argument and set the ping count
|
||||
if len(args) > 1:
|
||||
count = int(args[1])
|
||||
if count > 20:
|
||||
|
|
Reference in a new issue