diff --git a/ProxySU/MainWindow.xaml b/ProxySU/MainWindow.xaml index 5676882..8bce445 100644 --- a/ProxySU/MainWindow.xaml +++ b/ProxySU/MainWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:ProxySU" mc:Ignorable="d" - Title="ProxySU - v2.4.23" Height="675" Width="650"> + Title="ProxySU - v2.4.24 Beta2" Height="675" Width="650"> diff --git a/ProxySU/MainWindow.xaml.cs b/ProxySU/MainWindow.xaml.cs index 239d027..7b56501 100644 --- a/ProxySU/MainWindow.xaml.cs +++ b/ProxySU/MainWindow.xaml.cs @@ -5690,6 +5690,13 @@ namespace ProxySU functionResult = RootAuthorityDetect(client); if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; } + functionResult = FileCheckExists(client, @"/etc/resolv.conf.proxysu"); + if (functionResult == true) + { + sshShellCommand = @"mv /etc/resolv.conf.proxysu /etc/resolv.conf "; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + } + sshShellCommand = @"command -v apt-get"; currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); getApt = !String.IsNullOrEmpty(currentShellCommandResult); @@ -5721,11 +5728,19 @@ namespace ProxySU //检测主机是否为纯ipv6的主机 onlyIpv6 = OnlyIpv6HostDetect(client); + + //如果未检测到有效的ip,连接就会被断开 + if (client.IsConnected == false) + { + return ; + } if (onlyIpv6 == true) { - SetUpNat64(client, true); - sshShellCommand = $"{sshCmdUpdate}"; - currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + functionResult = SetUpNat64(client, true); + if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return ; } + //SetUpNat64(client, true); + //sshShellCommand = $"{sshCmdUpdate}"; + //currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); } @@ -6434,8 +6449,8 @@ namespace ProxySU if (onlyIpv6 == true) { SetUpNat64(client, false); - sshShellCommand = $"{sshCmdUpdate}"; - currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + //sshShellCommand = $"{sshCmdUpdate}"; + //currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); } @@ -8524,8 +8539,6 @@ namespace ProxySU sshShellCommand = @"yum -y install caddy"; currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); - - } string caddyService = @"/lib/systemd/system/caddy.service"; @@ -8540,15 +8553,16 @@ namespace ProxySU sshShellCommand = $"sed -i 's/=caddy/=root/g' {caddyService}"; currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + sshShellCommand = $"sed -i 's/LimitNPROC/#LimitNPROC/g' {caddyService}"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = $"sed -i 's/LimitNOFILE/#LimitNOFILE/g' {caddyService}"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + sshShellCommand = @"systemctl daemon-reload"; currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); - //sshShellCommand = @"find / -name caddy"; - //sshShellCommand = @"if [[ -f /usr/bin/caddy ]];then echo '1';else echo '0'; fi"; - //currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); - //if (!currentShellCommandResult.Contains("/usr/bin/caddy")) - //if (currentShellCommandResult.Trim().Equals("0") == true) functionResult = FileCheckExists(client, @"/usr/bin/caddy"); if (functionResult == true) { @@ -8623,8 +8637,8 @@ namespace ProxySU currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); //设置伪装网站/纯ipv6主机暂不设置 - if (String.IsNullOrEmpty(ReceiveConfigurationParameters[7]) == false && onlyIpv6 == false) - { + //if (String.IsNullOrEmpty(ReceiveConfigurationParameters[7]) == false && onlyIpv6 == false) + //{ sshShellCommand = $"sed -i 's/##reverse_Proxy1##/reverse_proxy http:\\/\\/{ReceiveConfigurationParameters[7]} {{/ ' {upLoadPath}"; currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); @@ -8634,7 +8648,7 @@ namespace ProxySU sshShellCommand = $"sed -i 's/##reverse_Proxy3##/}}/' {upLoadPath}"; currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); - } + //} return true; } diff --git a/ProxySU/Properties/AssemblyInfo.cs b/ProxySU/Properties/AssemblyInfo.cs index e81a312..60b13cf 100644 --- a/ProxySU/Properties/AssemblyInfo.cs +++ b/ProxySU/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.4.23.0")] -[assembly: AssemblyFileVersion("2.4.23.0")] +[assembly: AssemblyVersion("2.4.24.0")] +[assembly: AssemblyFileVersion("2.4.24.0")] diff --git a/ProxySU/bin/Beta/Beta.zip b/ProxySU/bin/Beta/Beta.zip index 5adee75..2572ef3 100644 Binary files a/ProxySU/bin/Beta/Beta.zip and b/ProxySU/bin/Beta/Beta.zip differ