Skip to content

Commit

Permalink
Update InstallNET.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
MoeClub authored Sep 1, 2021
1 parent 4a6d477 commit 6c041db
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions InstallNET.sh
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ function getGrub(){
echo "${folder}:${fileName}:${ver}"
}

function lowmem(){
mem=`grep "^MemTotal:" /proc/meminfo 2>/dev/null |grep -o "[0-9]*"`
[ -n "$mem" ] || return 0
[ "$mem" -le "524288" ] && return 1 || return 0
}

if [[ "$loaderMode" == "0" ]]; then
Grub=`getGrub "/boot"`
[ -z "$Grub" ] && echo -ne "Error! Not Found grub.\n" && exit 1;
Expand Down Expand Up @@ -531,6 +537,8 @@ if [[ "$loaderMode" == "0" ]]; then

[[ "$setInterfaceName" == "1" ]] && Add_OPTION="net.ifnames=0 biosdevname=0" || Add_OPTION=""
[[ "$setIPv6" == "1" ]] && Add_OPTION="$Add_OPTION ipv6.disable=1"

lowmem || Add_OPTION="$Add_OPTION lowmem/low=true"

if [[ "$linux_relese" == 'debian' ]] || [[ "$linux_relese" == 'ubuntu' ]]; then
BOOT_OPTION="auto=true $Add_OPTION hostname=$linux_relese domain= -- quiet"
Expand Down

0 comments on commit 6c041db

Please sign in to comment.