48 lines
1.3 KiB
Batchfile
Executable File
48 lines
1.3 KiB
Batchfile
Executable File
@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%\PensSSH-Win64" "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 |