mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 12:35:46 +00:00
Bind the TUN toggle button to starting/stoppping hev-socsk5-tunnel
This commit is contained in:
parent
ebdfb34670
commit
9c7fddf4e4
2 changed files with 11 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue