mirror of
https://github.com/2dust/v2rayN.git
synced 2025-07-02 04:52:09 +00:00
parent
0accf262dc
commit
a3e45d206e
1 changed files with 11 additions and 4 deletions
|
@ -112,9 +112,16 @@ namespace ServiceLib.Handler
|
||||||
#region Linux
|
#region Linux
|
||||||
|
|
||||||
private static async Task ClearTaskLinux()
|
private static async Task ClearTaskLinux()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
File.Delete(GetHomePathLinux());
|
File.Delete(GetHomePathLinux());
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logging.SaveLog(ex.Message, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static async Task SetTaskLinux()
|
private static async Task SetTaskLinux()
|
||||||
{
|
{
|
||||||
|
@ -127,8 +134,6 @@ namespace ServiceLib.Handler
|
||||||
Logging.SaveLog(linuxConfig);
|
Logging.SaveLog(linuxConfig);
|
||||||
|
|
||||||
var homePath = GetHomePathLinux();
|
var homePath = GetHomePathLinux();
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(homePath));
|
|
||||||
|
|
||||||
await File.WriteAllTextAsync(homePath, linuxConfig);
|
await File.WriteAllTextAsync(homePath, linuxConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,7 +145,9 @@ namespace ServiceLib.Handler
|
||||||
|
|
||||||
private static string GetHomePathLinux()
|
private static string GetHomePathLinux()
|
||||||
{
|
{
|
||||||
return Path.Combine(Utils.GetHomePath(), ".config", "autostart", $"{Global.AppName}.desktop");
|
var homePath = Path.Combine(Utils.GetHomePath(), ".config", "autostart", $"{Global.AppName}.desktop");
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(homePath));
|
||||||
|
return homePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Linux
|
#endregion Linux
|
||||||
|
|
Loading…
Reference in a new issue