ping timeout
This commit is contained in:
parent
72ae1b1df5
commit
20a9ce89af
2
main.py
2
main.py
@ -44,7 +44,7 @@ def ping(message):
|
|||||||
if not ip:
|
if not ip:
|
||||||
bot.send_message(message.chat.id, 'Используйте комманду /ping 127.0.0.1: ')
|
bot.send_message(message.chat.id, 'Используйте комманду /ping 127.0.0.1: ')
|
||||||
else:
|
else:
|
||||||
resource = os.system("ping -c 1 " + ip)
|
resource = os.system("ping -c 1 -w 1 " + ip)
|
||||||
if resource == 0:
|
if resource == 0:
|
||||||
bot.reply_to(message, "Is UP")
|
bot.reply_to(message, "Is UP")
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user