Skip to content

Commit 9ee524f

Browse files
committed
fix: report unsupported Tun state for systemd-user backend
1 parent 3d6a523 commit 9ee524f

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ bash install.sh
8282
clashctl log/logs 📜 查看日志
8383

8484
💡 显示更多帮助命令:clashctl -h
85-
💡 更多高级能力:clashctl help advanced
8685
```
8786
8887
------

scripts/core/clashctl.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4872,8 +4872,11 @@ doctor_tun_checks() {
48724872
process_cap_rc=2
48734873
case "$backend" in
48744874
systemd|systemd-user)
4875-
tun_process_has_cap_net_admin "$backend" >/dev/null 2>&1
4876-
process_cap_rc=$?
4875+
if tun_process_has_cap_net_admin "$backend" >/dev/null 2>&1; then
4876+
process_cap_rc=0
4877+
else
4878+
process_cap_rc=$?
4879+
fi
48774880
;;
48784881
esac
48794882

@@ -5342,8 +5345,11 @@ tun_doctor_primary_reason() {
53425345
process_cap_rc=2
53435346
case "$backend" in
53445347
systemd|systemd-user)
5345-
tun_process_has_cap_net_admin "$backend" >/dev/null 2>&1
5346-
process_cap_rc=$?
5348+
if tun_process_has_cap_net_admin "$backend" >/dev/null 2>&1; then
5349+
process_cap_rc=0
5350+
else
5351+
process_cap_rc=$?
5352+
fi
53475353
;;
53485354
esac
53495355

0 commit comments

Comments
 (0)