From 65cdeb8d5e501e4094f756a1606fa8f0e2f709f8 Mon Sep 17 00:00:00 2001 From: USER Date: Tue, 3 Oct 2023 18:24:45 +0100 Subject: [PATCH] . --- README.md | 7 +++++-- bin/InstallSSH.bat | 20 ++++++++++++------- .../InstallSSH.bat} | 20 +++++++------------ 3 files changed, 25 insertions(+), 22 deletions(-) rename bin/{InstallSSH2.bat => archive/InstallSSH.bat} (72%) diff --git a/README.md b/README.md index 368a811..3dabc6c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ -Run InstallSSH.bat in an Administrator command prompt - +1) Download zip of repo +2) mkdir C:\Scripts +3) Unpack wPublic to C:\Scripts\wPublic +4) Start command prompt in ADMINISTRATOR mode +5) Run C:\Scripts\wPublic\InstalSSh.bat in the above command prompt diff --git a/bin/InstallSSH.bat b/bin/InstallSSH.bat index f1674a2..8af5a5d 100755 --- a/bin/InstallSSH.bat +++ b/bin/InstallSSH.bat @@ -9,6 +9,7 @@ mkdir %PACKAGES% call %WPUBLIC%\bin\SpeedUpPS.bat +echo "------- attempting uninstall first" set PSFILE="C:\Program Files\OpenSSH\uninstall-sshd.ps1" if exist %PSFILE% ( echo "SSH uninstall script" @@ -18,27 +19,32 @@ if exist %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" + del /f/s/q "C:\Packages\OpenSSH-Win64\*.*" rmdir /s/q "C:\Packages\OpenSSH-Win64" -echo "Download and unpack OpenSSH" +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 ( +@REM if exist "C:\Program Files\OpenSSH\sshd.exe" ( +@REM echo "OPENSSH already installed" +@REM ) +@REM else ( echo "NEW installation" robocopy "%PACKAGES%\OpenSSH-Win64" "C:\Program Files\OpenSSH" /E - ) - +@REM ) + +echo "------- attempting install" set PSFILE="C:\Program Files\OpenSSH\install-sshd.ps1" if exist %PSFILE% ( echo "SSH install script" Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% ) +echo "------- fix firewall" set PSFILE="%WPUBLIC%\bin\Firewall.ps1" if exist %PSFILE% ( Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% diff --git a/bin/InstallSSH2.bat b/bin/archive/InstallSSH.bat similarity index 72% rename from bin/InstallSSH2.bat rename to bin/archive/InstallSSH.bat index 8af5a5d..f1674a2 100755 --- a/bin/InstallSSH2.bat +++ b/bin/archive/InstallSSH.bat @@ -9,7 +9,6 @@ mkdir %PACKAGES% call %WPUBLIC%\bin\SpeedUpPS.bat -echo "------- attempting uninstall first" set PSFILE="C:\Program Files\OpenSSH\uninstall-sshd.ps1" if exist %PSFILE% ( echo "SSH uninstall script" @@ -19,32 +18,27 @@ if exist %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" - del /f/s/q "C:\Packages\OpenSSH-Win64\*.*" rmdir /s/q "C:\Packages\OpenSSH-Win64" -echo "------- Download and unpack OpenSSH" +echo "Download and unpack OpenSSH" set PSFILE="%WPUBLIC%\bin\Download.ps1" Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% -@REM if exist "C:\Program Files\OpenSSH\sshd.exe" ( -@REM echo "OPENSSH already installed" -@REM ) -@REM else ( +if exist "C:\Program Files\OpenSSH\sshd.exe" ( + echo "OPENSSH already installed" + ) + else ( echo "NEW installation" robocopy "%PACKAGES%\OpenSSH-Win64" "C:\Program Files\OpenSSH" /E -@REM ) - -echo "------- attempting install" + ) + set PSFILE="C:\Program Files\OpenSSH\install-sshd.ps1" if exist %PSFILE% ( echo "SSH install script" Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% ) -echo "------- fix firewall" set PSFILE="%WPUBLIC%\bin\Firewall.ps1" if exist %PSFILE% ( Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%