From 20a9ce89af834b25a751e3f3889f44745f9522e2 Mon Sep 17 00:00:00 2001 From: 3err0 Date: Mon, 24 Jun 2019 15:50:23 +0800 Subject: [PATCH] ping timeout --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 6f0de80..ae90349 100644 --- a/main.py +++ b/main.py @@ -44,7 +44,7 @@ def ping(message): if not ip: bot.send_message(message.chat.id, 'Используйте комманду /ping 127.0.0.1: ') else: - resource = os.system("ping -c 1 " + ip) + resource = os.system("ping -c 1 -w 1 " + ip) if resource == 0: bot.reply_to(message, "Is UP") else: @@ -88,4 +88,4 @@ if __name__ == '__main__': except Exception as e: print(e) finally: - os.remove(pidf) \ No newline at end of file + os.remove(pidf)