File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
22
33GRUB_MENU_ACCESSIBLE=" $1 "
4-
5- set -x
4+ WAIT_HOW_LONG=" $2 " # set to -1 to wait forever
65
76GRUB_CONFIG=" /etc/default/grub"
87
9- echo " Show full GRUB config before"
10- cat $GRUB_CONFIG
8+ set -x
9+
10+ echo " Show relevant settings before:"
11+ grep " TIMEOUT_STYLE" $GRUB_CONFIG
12+ grep " GRUB_TIMEOUT=" $GRUB_CONFIG
1113
1214if [ " $GRUB_MENU_ACCESSIBLE " = " True" ]; then
13- sed --in-place " s/GRUB_TIMEOUT_STYLE=hidden/GRUB_TIMEOUT_STYLE=menu/" $GRUB_CONFIG
14- sed --in-place " s/GRUB_TIMEOUT=0 /GRUB_TIMEOUT=40 /" $GRUB_CONFIG
15+ sed --in-place " s/GRUB_TIMEOUT_STYLE=hidden/GRUB_TIMEOUT_STYLE=menu/" $GRUB_CONFIG
16+ sed --in-place " s/GRUB_TIMEOUT=.* /GRUB_TIMEOUT=$WAIT_HOW_LONG /" $GRUB_CONFIG
1517else
16- sed --in-place " s/GRUB_TIMEOUT_STYLE=menu/GRUB_TIMEOUT_STYLE=hidden/" $GRUB_CONFIG
17- sed --in-place " s/GRUB_TIMEOUT=30 /GRUB_TIMEOUT=0/" $GRUB_CONFIG
18+ sed --in-place " s/GRUB_TIMEOUT_STYLE=menu/GRUB_TIMEOUT_STYLE=hidden/" $GRUB_CONFIG
19+ sed --in-place " s/GRUB_TIMEOUT=.* /GRUB_TIMEOUT=0/" $GRUB_CONFIG
1820fi
1921
20- echo " Show relevant settings after:"
21- grep " TIMEOUT_STYLE" $GRUB_CONFIG
22- grep " GRUB_TIMEOUT=" $GRUB_CONFIG
22+ echo " Show full GRUB config after:"
23+ cat $GRUB_CONFIG
2324
24- # Now update GRUB with the new settings
25+ # Now update GRUB's actual configuration with the new settings
2526update-grub
You can’t perform that action at this time.
0 commit comments