Created
October 19, 2021 08:37
-
-
Save kripul/96882d27946e1a74796d28c7e1e3a870 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#read -p "link file GZ : " linkgz | |
read -p "IP : " serverip | |
read -p "GATEWAY : " servergw | |
cat >/tmp/net.bat<<EOF | |
@ECHO OFF | |
cd.>%windir%\GetAdmin | |
if exist %windir%\GetAdmin (del /f /q "%windir%\GetAdmin") else ( | |
echo CreateObject^("Shell.Application"^).ShellExecute "%~s0", "%*", "", "runas", 1 >> "%temp%\Admin.vbs" | |
"%temp%\Admin.vbs" | |
del /f /q "%temp%\Admin.vbs" | |
exit /b 2) | |
netsh -c interface ip set address name="Ethernet 2" source=static address=$serverip mask=255.255.240.0 gateway=$servergw | |
netsh -c interface ip add dnsservers name="Ethernet 2" address=8.8.8.8 index=1 validate=no | |
netsh -c interface ip add dnsservers name="Ethernet 2" address=8.8.4.4 index=2 validate=no | |
EOF | |
wget -O- http://137.184.212.233/windows2019.gz | gunzip | dd of=/dev/vda bs=3M status=progress | |
mount.ntfs-3g /dev/vda2 /mnt | |
cd '/mnt/ProgramData/Microsoft/Windows/Start Menu/Programs' | |
cd Start* || cd start* | |
cp -f /tmp/net.bat net.bat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment