Bind the TUN toggle button to starting/stoppping hev-socsk5-tunnel

This commit is contained in:
Valeriy Manzhos 2026-04-08 18:43:42 +03:00
parent ebdfb34670
commit 9c7fddf4e4
No known key found for this signature in database
GPG key ID: 6547CFC8E2EC3D90
2 changed files with 11 additions and 1 deletions

View file

@ -88,6 +88,12 @@ public class CoreManager
await WindowsUtils.RemoveTunDevice();
}
if (Utils.IsLinux() && !_config.TunModeItem.EnableTun)
{
await DeleteTUNRoutes();
await KillTUNProcess();
}
await CoreStart(mainContext);
await CoreStartPreService(preContext);

View file

@ -480,6 +480,10 @@ public class StatusBarViewModel : MyReactiveObject
await AppManager.Instance.RebootAsAdmin();
return;
}
else if (Utils.IsLinux()) {
await CoreManager.StartTUNProcess();
await CoreManager.CreateTUNRoutes();
}
else
{
bool? passwordResult = await _updateView?.Invoke(EViewAction.PasswordInput, null);
@ -502,7 +506,7 @@ public class StatusBarViewModel : MyReactiveObject
}
else if (Utils.IsLinux())
{
return AppManager.Instance.LinuxSudoPwd.IsNotEmpty();
return false;
}
else if (Utils.IsMacOS())
{