Fix regular expressions to work with Jessie grub

This commit is contained in:
Jan Dittberner 2016-03-02 20:56:02 +01:00 committed by Holger Levsen
parent cc5dbbe97b
commit 2c39e8f284
2 changed files with 3 additions and 3 deletions

View file

@ -29,7 +29,7 @@ if [ $(echo "$LANGSEL" | wc -l) -eq 2 ]; then
else
# Selected language is the last in the file
LANG="$LANGSEL"
NEXTLANG="$(egrep -v "^[[:space:]]*(#.*)?$" langlist | head -n1)"
NEXTLANG="$(egrep -v '^[[:space:]]*(#.*)?$' langlist | head -n1)"
fi
LOCALE=$(echo "$LANG" | cut -d: -f1)
@ -39,7 +39,7 @@ GRUBLINE=$(echo "$LANG" | cut -d: -f4)
sed -i "s/LANGNAME \".*\"/LANGNAME \"$LANGNAME\"/" preseed_early
sed -i "s/locale=.*$/locale=$LOCALE $GRUBLINE/
s/^set default=.*$/set default=\"2\"/" $ROOT/boot/grub/grub.cfg
s/^\([[:space:]]*\)set default=\"[[:digit:]]*\"$/\1set default=\"2\"/" $ROOT/boot/grub/grub.cfg
# Comment out the next three lines if you don't want the language to change
N_LOCALE=$(echo "$NEXTLANG" | cut -d: -f1)