move --server check into daemon.plist

This commit is contained in:
rustdesk 2024-06-19 19:54:30 +08:00
parent adf0226641
commit d75caad71f
2 changed files with 3 additions and 3 deletions

View File

@ -501,7 +501,7 @@ pub fn start_os_service() {
std::fs::canonicalize(std::env::current_exe().unwrap_or_default()).unwrap_or_default();
let mut server = get_server_start_time(&mut sys, &path);
if server.is_none() {
log::error!("Agent not started yet, will restart --service to make delegate work",);
log::error!("Agent not started yet, please restart --server first to make delegate work",);
std::process::exit(-1);
}
let my_start_time = sys
@ -518,7 +518,7 @@ pub fn start_os_service() {
if let Some((start_time, pid)) = server {
if my_start_time <= start_time + 1 {
log::error!(
"Agent start later, {my_start_time} vs {start_time}, will restart --service to make delegate work",
"Agent start later, {my_start_time} vs {start_time}, please start --server first to make delegate work",
);
std::process::exit(-1);
}

View File

@ -12,7 +12,7 @@
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>sleep 3; /Applications/RustDesk.app/Contents/MacOS/RustDesk --service</string>
<string>sleep 3; if pgrep -f '/Applications/RustDesk.app/Contents/MacOS/RustDesk --server' > /dev/null; then /Applications/RustDesk.app/Contents/MacOS/RustDesk --service; fi</string>
</array>
<key>RunAtLoad</key>
<true/>