From 9da3b534a11e69352b4ef771424e2a79b6733e1e Mon Sep 17 00:00:00 2001 From: USER Date: Wed, 27 Sep 2023 20:41:50 +0100 Subject: [PATCH] . --- bin/InstallSSH2.bat | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 bin/InstallSSH2.bat diff --git a/bin/InstallSSH2.bat b/bin/InstallSSH2.bat new file mode 100755 index 0000000..dd20c9b --- /dev/null +++ b/bin/InstallSSH2.bat @@ -0,0 +1,48 @@ +@echo off +set check_computername=%COMPUTERNAME% +echo "Found computer %check_computername%" + +set PACKAGES="C:\Packages" +set WPUBLIC="C:\wPublic" + +mkdir %PACKAGES% + +call %WPUBLIC%\bin\SpeedUpPS.bat + +set PSFILE="C:\Program Files\OpenSSH\uninstall-sshd.ps1" +if exist %PSFILE% ( + echo "SSH uninstall script" + Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% +) + +del /f/s/q "C:\Program Files\OpenSSH\*.*" +rmdir /s/q "C:\Program Files\OpenSSH" + +del /f/s/q "C:\Packages\openssh-portable-9.2.2.0\*.*" +rmdir /s/q "C:\Packages\openssh-portable-9.2.2.0" + +echo "Download and unpack OpenSSH" +set PSFILE="%WPUBLIC%\bin\Download.ps1" +Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% + +if exist "C:\Program Files\OpenSSH\sshd.exe" ( + echo "OPENSSH already installed" + ) + else ( + echo "NEW installation" + robocopy "%PACKAGES%\openssh-portable-9.2.2.0" "C:\Program Files\OpenSSH" /E + ) + +set PSFILE="C:\Program Files\OpenSSH\install-sshd.ps1" +if exist %PSFILE% ( + echo "SSH install script" + Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% +) + +set PSFILE="%WPUBLIC%\bin\Firewall.ps1" +if exist %PSFILE% ( + Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% + net start sshd +) + +curl.exe --output C:\BaseGitClone.bat --url https://mint.nopenso.com/mirror/wBase/raw/branch/main/BaseGitClone.bat \ No newline at end of file