mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-03 03:19:27 +08:00
sync config if enable mac service
This commit is contained in:
parent
5af1258454
commit
e0637f966a
@ -131,7 +131,7 @@ pub fn is_installed_daemon(prompt: bool) -> bool {
|
||||
.arg(&get_active_username())
|
||||
.spawn()
|
||||
{
|
||||
Ok(mut proc) => {
|
||||
Ok(_) => {
|
||||
std::process::exit(0);
|
||||
}
|
||||
Err(e) => {
|
||||
@ -157,6 +157,7 @@ pub fn launch(load: bool) {
|
||||
std::process::Command::new("osascript")
|
||||
.arg("-e")
|
||||
.arg(script_body)
|
||||
.arg(&get_active_username())
|
||||
.spawn()
|
||||
.ok();
|
||||
}
|
||||
|
@ -1,6 +1,16 @@
|
||||
set sh1 to "launchctl load -w /Library/LaunchDaemons/com.carriez.rustdesk_service.plist;"
|
||||
set sh2 to "launchctl load -w /Library/LaunchAgents/com.carriez.rustdesk_server.plist;"
|
||||
on run {user}
|
||||
|
||||
do shell script sh1 with prompt "RustDesk want to launch daemon" with administrator privileges
|
||||
do shell script sh2
|
||||
set sh1 to "cp -rf /Users/" & user & "/Library/Preferences/com.carriez.RustDesk/RustDesk.toml /var/root/Library/Preferences/com.carriez.RustDesk/;"
|
||||
|
||||
set sh2 to "cp -rf /Users/" & user & "/Library/Preferences/com.carriez.RustDesk/RustDesk2.toml /var/root/Library/Preferences/com.carriez.RustDesk/;"
|
||||
|
||||
set sh3 to "launchctl load -w /Library/LaunchDaemons/com.carriez.rustdesk_service.plist;"
|
||||
|
||||
set sh4 to "launchctl load -w /Library/LaunchAgents/com.carriez.rustdesk_server.plist;"
|
||||
|
||||
set sh to sh1 & sh2 & sh3
|
||||
|
||||
do shell script sh with prompt "RustDesk want to launch daemon" with administrator privileges
|
||||
do shell script sh4
|
||||
|
||||
end run
|
||||
|
Loading…
Reference in New Issue
Block a user