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>>()
|
.collect::<Vec<String>>()
|
||||||
.join("\\n");
|
.join("\\n");
|
||||||
|
|
||||||
let output = if config.patch.root {
|
let output = Command::new("pkexec")
|
||||||
Command::new("pkexec")
|
.arg("echo")
|
||||||
.arg("echo")
|
.arg("-e")
|
||||||
.arg("-e")
|
.arg(format!("\\n{telemetry}\\n"))
|
||||||
.arg(format!("\\n{telemetry}\\n"))
|
.arg(">>")
|
||||||
.arg(">>")
|
.arg("/etc/hosts")
|
||||||
.arg("/etc/hosts")
|
.spawn();
|
||||||
.spawn()
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
|
||||||
Command::new("echo")
|
|
||||||
.arg("-e")
|
|
||||||
.arg(format!("\\n{telemetry}\\n"))
|
|
||||||
.arg(">>")
|
|
||||||
.arg("/etc/hosts")
|
|
||||||
.spawn()
|
|
||||||
};
|
|
||||||
|
|
||||||
match output.and_then(|child| child.wait_with_output()) {
|
match output.and_then(|child| child.wait_with_output()) {
|
||||||
Ok(output) => if !output.status.success() {
|
Ok(output) => if !output.status.success() {
|
||||||
|
|
Loading…
Reference in a new issue