mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-01 03:42:07 +08:00
fix polkit (#7360)
Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
This commit is contained in:
@@ -613,7 +613,10 @@ fn uninstall_service() -> Result<()> {
|
||||
let status = if linux_running_as_root() {
|
||||
StdCommand::new(&uninstall_path).status()?
|
||||
} else {
|
||||
let result = StdCommand::new(&elevator).arg(&uninstall_path).status()?;
|
||||
let result = StdCommand::new(&elevator)
|
||||
.arg("--disable-internal-agent")
|
||||
.arg(&uninstall_path)
|
||||
.status()?;
|
||||
|
||||
// 如果 pkexec 执行失败,回退到 sudo
|
||||
if !result.success() && elevator.contains("pkexec") {
|
||||
@@ -661,7 +664,10 @@ fn install_service() -> Result<()> {
|
||||
let output = if linux_running_as_root() {
|
||||
StdCommand::new(&install_path).output()?
|
||||
} else {
|
||||
let result = StdCommand::new(&elevator).arg(&install_path).output()?;
|
||||
let result = StdCommand::new(&elevator)
|
||||
.arg("--disable-internal-agent")
|
||||
.arg(&install_path)
|
||||
.output()?;
|
||||
|
||||
// 如果 pkexec 执行失败,回退到 sudo
|
||||
if !result.status.success() && elevator.contains("pkexec") {
|
||||
|
||||
Reference in New Issue
Block a user