fix(core): fixed disable telemetry function
A bit different from the mainline launcher
This commit is contained in:
parent
222a26400a
commit
c26ce924d0
1 changed files with 7 additions and 18 deletions
|
@ -20,24 +20,13 @@ pub fn disable_telemetry(sender: ComponentSender<App>) {
|
|||
.collect::<Vec<String>>()
|
||||
.join("\\n");
|
||||
|
||||
let output = if config.patch.root {
|
||||
Command::new("pkexec")
|
||||
.arg("echo")
|
||||
.arg("-e")
|
||||
.arg(format!("\\n{telemetry}\\n"))
|
||||
.arg(">>")
|
||||
.arg("/etc/hosts")
|
||||
.spawn()
|
||||
}
|
||||
|
||||
else {
|
||||
Command::new("echo")
|
||||
.arg("-e")
|
||||
.arg(format!("\\n{telemetry}\\n"))
|
||||
.arg(">>")
|
||||
.arg("/etc/hosts")
|
||||
.spawn()
|
||||
};
|
||||
let output = Command::new("pkexec")
|
||||
.arg("echo")
|
||||
.arg("-e")
|
||||
.arg(format!("\\n{telemetry}\\n"))
|
||||
.arg(">>")
|
||||
.arg("/etc/hosts")
|
||||
.spawn();
|
||||
|
||||
match output.and_then(|child| child.wait_with_output()) {
|
||||
Ok(output) => if !output.status.success() {
|
||||
|
|
Loading…
Reference in a new issue