mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-15 21:54:40 +08:00
Update InstallNET.sh
This commit is contained in:
parent
a08f2b1ff4
commit
691947e6bd
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue