File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ GRUB_MENU_ACCESSIBLE=" $1 "
4
+ WAIT_HOW_LONG=" $2 " # set to -1 to wait forever
5
+
6
+ GRUB_CONFIG=" /etc/default/grub"
7
+
8
+ set -x
9
+
10
+ echo " Show relevant settings before:"
11
+ grep " TIMEOUT_STYLE" $GRUB_CONFIG
12
+ grep " GRUB_TIMEOUT=" $GRUB_CONFIG
13
+
14
+ if [ " $GRUB_MENU_ACCESSIBLE " = " True" ]; then
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
17
+ else
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
20
+ fi
21
+
22
+ echo " Show full GRUB config after:"
23
+ cat $GRUB_CONFIG
24
+
25
+ # Now update GRUB's actual configuration with the new settings
26
+ update-grub
You can’t perform that action at this time.
0 commit comments