feat: (yet again) updated telemetry disabling

This commit is contained in:
Observer KRypt0n_ 2023-06-28 11:47:11 +02:00
parent 1cb1f045c0
commit 40d0b8a399
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2

View file

@ -16,22 +16,22 @@ pub fn disable_telemetry(sender: ComponentSender<App>) {
let telemetry = config.launcher.edition
.telemetry_servers()
.iter()
.map(|server| format!("0.0.0.0 {server}"))
.map(|server| format!("echo '0.0.0.0 {server}' >> /etc/hosts"))
.collect::<Vec<String>>()
.join("\\n");
.join(" ; ");
let output = if config.patch.root {
Command::new("pkexec")
.arg("sh")
.arg("bash")
.arg("-c")
.arg(format!("echo -e \"\\n{telemetry}\\n\" >> /etc/hosts"))
.arg(telemetry)
.spawn()
}
else {
Command::new("sh")
Command::new("bash")
.arg("-c")
.arg(format!("echo -e \"\\n{telemetry}\\n\" >> /etc/hosts"))
.arg(telemetry)
.spawn()
};