OracleISOs / installer
Josias094's picture
Upload installer
ed290ac verified
#!/bin/bash
function check_root {
if [ "$EUID" -ne 0 ]; then
echo "Este script debe ejecutarse con privilegios de root. Por favor, utilice sudo o ejecute como root."
exit 1
fi
}
function check_install {
programs=("xz-utils" "openssl" "gawk" "file" "wget" "figlet")
for program in "${programs[@]}"; do
if ! command -v "$program" &> /dev/null; then
echo "$program no est谩 instalado. Instalando..."
apt update
apt install -y "$program"
echo "Instalando $program..."
echo "$program instalado correctamente."
fi
done
}
function download_installnet {
if [ ! -f "InstallNET.sh" ]; then
echo "Descargando InstallNET.sh..."
wget -q --show-progress "https://archive.org/download/install-net/InstallNET.sh" -O InstallNET.sh
echo "InstallNET.sh descargado correctamente."
fi
}
function cleanup {
echo "Operaci贸n cancelada. Eliminando InstallNET.sh..."
rm -f InstallNET.sh
rm -f installer
echo "InstallNET.sh eliminado."
exit 1
}
function install_windows {
installer_path="InstallNET.sh"
version_url="$1"
download_installnet
check_install
clear
figlet -c Hircoir
figlet -c hircoir.eu.org
sleep 3
clear
sleep 2
echo "Este script solo est谩 probado con Oracle Cloud, la instalaci贸n dura de 1 hora a 1 hora con 30 minutos aprox... Al instalarse cambie la contrase帽a de administrador para mayor seguridad"
echo
sleep 10
figlet -c Administrator
sleep 3
echo "Contrase帽a de Administrador:"
figlet -c "nat.ee"
sleep 4
clear
figlet -c Iniciando
sleep 2
# Obt茅n la ruta del script actual
script_path="$(readlink -f "$0")"
# Usa la ruta completa al archivo InstallNET.sh
install_script_path="$(dirname "$script_path")/InstallNET.sh"
bash "$install_script_path" -dd "$version_url"
}
trap cleanup INT TERM
check_root
while true; do
echo "Elija la versi贸n de Windows que desea instalar:"
echo "1) Windows 7 x64"
echo "2) Windows Server 2012 x64"
echo "3) Windows Server 2016 x64"
echo "4) Windows 10 LTSC 2021 Chino x64"
echo "5) Salir"
read -p "Seleccione una opci贸n (1-5): " op
installer_path="InstallNET.sh"
case $op in
1)
install_windows "https://huggingface.co/HirCoir/dd-windows/resolve/main/Windows-7-SP1-x64-US-EFI-Pass%20is-nat.ee.vhd.gz"
break
;;
2)
install_windows "https://huggingface.co/HirCoir/dd-windows/resolve/main/winsrv2012r2-data-x64-us-efi.vhd.gz"
break
;;
3)
install_windows "https://huggingface.co/HirCoir/dd-windows/resolve/main/winsrv2016-data-x64-us-efi.vhd.gz"
break
;;
4)
install_windows "https://huggingface.co/Josias094/OracleISOs/blob/main/Win10-ent-ltsc-2021-x64-cn-efi.vhd.gz"
break
;;
5)
cleanup
;;
*)
echo "Opci贸n no v谩lida. Por favor, seleccione una opci贸n del 1 al 5."
;;
esac
done