From 691947e6bd8ea226e99d3b11ca393cec000ae4dd Mon Sep 17 00:00:00 2001 From: Molly Lau Date: Mon, 5 Dec 2022 16:10:50 +0900 Subject: [PATCH] Update InstallNET.sh --- Linux_reinstall/InstallNET.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Linux_reinstall/InstallNET.sh b/Linux_reinstall/InstallNET.sh index d91ccba..aa89a39 100644 --- a/Linux_reinstall/InstallNET.sh +++ b/Linux_reinstall/InstallNET.sh @@ -1443,6 +1443,7 @@ if [[ ! -z "$GRUBTYPE" && "$GRUBTYPE" == "isGrub1" ]]; then # Backup original grub config file cp $GRUBDIR/$GRUBFILE "$GRUBDIR/$GRUBFILE_$(date "+%Y%m%d%H%M").bak" # Read grub file, search boot item +# Some grub file is written as a binary file, add parameter "-a, --text" process this file as if it were text; this is equivalent to the --binary-files=text option cat $GRUBDIR/$GRUBFILE |sed -n '1h;1!H;$g;s/\n/%%%%%%%/g;$p' |grep -aom 1 'menuentry\ [^{]*{[^}]*}%%%%%%%' |sed 's/%%%%%%%/\n/g' >$READGRUB LoadNum="$(cat $READGRUB |grep -c 'menuentry ')" if [[ "$LoadNum" -eq '1' ]]; then