mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-02-03 14:30:50 +03:00
Use 'sh -c' to properly execute 'echo' when disabling telemetry
This commit is contained in:
parent
67ba65a3dc
commit
3ba2beb37d
1 changed files with 6 additions and 10 deletions
|
@ -22,20 +22,16 @@ pub fn disable_telemetry(sender: ComponentSender<App>) {
|
|||
|
||||
let output = if config.patch.root {
|
||||
Command::new("pkexec")
|
||||
.arg("echo")
|
||||
.arg("-e")
|
||||
.arg(format!("\\n{telemetry}\\n"))
|
||||
.arg(">>")
|
||||
.arg("/etc/hosts")
|
||||
.arg("sh")
|
||||
.arg("-c")
|
||||
.arg(format!("echo \"\\n{telemetry}\\n\" >> /etc/hosts"))
|
||||
.spawn()
|
||||
}
|
||||
|
||||
else {
|
||||
Command::new("echo")
|
||||
.arg("-e")
|
||||
.arg(format!("\\n{telemetry}\\n"))
|
||||
.arg(">>")
|
||||
.arg("/etc/hosts")
|
||||
Command::new("sh")
|
||||
.arg("-c")
|
||||
.arg(format!("echo \"\\n{telemetry}\\n\" >> /etc/hosts"))
|
||||
.spawn()
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue