Update InstallNET.sh

This commit is contained in:
Molly Lau 2023-11-14 20:31:52 +09:00 committed by GitHub
parent 25fbd2d9e3
commit bbfb980553
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1204,27 +1204,15 @@ function checkMem() {
exit 1 exit 1
} }
if [[ "$1" == 'rockylinux' || "$1" == 'almalinux' || "$1" == 'centos' ]]; then if [[ "$1" == 'rockylinux' || "$1" == 'almalinux' || "$1" == 'centos' ]]; then
if [[ "$2" == "8" ]] || [[ "$1" == 'centos' && "$2" -ge "9" ]]; then if [[ "$2" == "8" ]] || [[ "$2" == "9" ]]; then
[[ "$TotalMem" -le "2228" ]] && { [[ "$TotalMem" -le "2228" ]] && {
echo -ne "\n[${red}Warning${plain}] Minimum system memory requirement is 2.2 GB for ${blue}KickStart${plain} native method.\n" echo -ne "\n[${red}Warning${plain}] Minimum system memory requirement is 2.2 GB for ${blue}KickStart${plain} native method.\n"
lowMemMode="1"
if [[ "$2" == "8" ]]; then if [[ "$2" == "8" ]]; then
echo -ne "\nSwitching to ${yellow}Rocky $2${plain} by ${blue}Cloud Init${plain} Installation... \n" echo -ne "\nSwitching to ${yellow}Rocky $2${plain} by ${blue}Cloud Init${plain} Installation... \n"
lowMemMode="1" elif [[ "$2" == "9" ]]; then
elif [[ "$1" == 'centos' && "$2" -ge "9" ]]; then
[[ "$TotalMem" -ge "2028" ]] && {
echo -ne "\nSwitching to ${yellow}AlmaLinux $2${plain} distribution... \n"
switchRedhatDIST="1"
} || {
echo -ne "\nSwitching to ${yellow}AlmaLinux $2${plain} by ${blue}Cloud Init${plain} Installation... \n"
lowMemMode="1"
}
fi
}
elif [[ "$2" -ge "9" ]]; then
[[ "$TotalMem" -le "2028" ]] && {
echo -ne "\n[${red}Warning${plain}] Minimum system memory requirement is 2 GB for ${blue}Kickstart${plain} native method.\n"
echo -ne "\nSwitching to ${blue}Cloud Init${plain} Installation... \n" echo -ne "\nSwitching to ${blue}Cloud Init${plain} Installation... \n"
lowMemMode="1" fi
} }
elif [[ "$2" == "7" ]]; then elif [[ "$2" == "7" ]]; then
[[ "$TotalMem" -le "1500" ]] && { [[ "$TotalMem" -le "1500" ]] && {
@ -3224,14 +3212,10 @@ clear
} }
} }
# RAM of RedHat series is 2GB required at least for native install, for dd is 512MB. # RAM of RedHat series is 2.2GB required at least for native install, for dd is 512MB.
[[ "$setNetbootXyz" == "0" ]] && { [[ "$setNetbootXyz" == "0" ]] && {
checkMem "$linux_relese" "$RedHatSeries" "$targetRelese" checkMem "$linux_relese" "$RedHatSeries" "$targetRelese"
Add_OPTION="$Add_OPTION $lowmemLevel" Add_OPTION="$Add_OPTION $lowmemLevel"
[[ "$switchRedhatDIST" == "1" ]] && {
Relese='AlmaLinux'
linux_relese='almalinux'
}
checkDIST checkDIST
} }