summaryrefslogtreecommitdiff
path: root/user/grub/update-grub
diff options
context:
space:
mode:
authorMax Rees <maxcrees@me.com>2019-09-09 01:20:30 -0500
committerMax Rees <maxcrees@me.com>2019-09-09 01:24:31 -0500
commit2b957d5e230510b304b7ffa72c6401c49ffdd41f (patch)
tree8add46d2b4b029a0e8c614084febe00e5f2fe9d6 /user/grub/update-grub
parentcf356b050604815c7d9df80aa2897d0b39ec751b (diff)
downloadpackages-2b957d5e230510b304b7ffa72c6401c49ffdd41f.tar.gz
packages-2b957d5e230510b304b7ffa72c6401c49ffdd41f.tar.bz2
packages-2b957d5e230510b304b7ffa72c6401c49ffdd41f.tar.xz
packages-2b957d5e230510b304b7ffa72c6401c49ffdd41f.zip
user/grub: fix some mistakes in update-grub
* If $ADELIE_MANUAL_CONFIG is empty or unset, the comparison will fail since it isn't a valid integer. use = instead of -eq * Make a backup of grub.cfg only if it exists
Diffstat (limited to 'user/grub/update-grub')
-rw-r--r--user/grub/update-grub6
1 files changed, 4 insertions, 2 deletions
diff --git a/user/grub/update-grub b/user/grub/update-grub
index c8c495390..d22930bd7 100644
--- a/user/grub/update-grub
+++ b/user/grub/update-grub
@@ -1,6 +1,6 @@
#!/bin/sh -e
. /etc/default/grub
-if [ "$ADELIE_MANUAL_CONFIG" -eq 1 ]; then
+if [ "$ADELIE_MANUAL_CONFIG" = 1 ]; then
cat >&2 <<-EOF
*
* You have specified that you are using a manual GRUB configuration.
@@ -10,5 +10,7 @@ if [ "$ADELIE_MANUAL_CONFIG" -eq 1 ]; then
exit 0
fi
-cp -p /boot/grub/grub.cfg /boot/grub/grub.cfg.update-grub-old
+if [ -e /boot/grub/grub.cfg ]; then
+ cp -p /boot/grub/grub.cfg /boot/grub/grub.cfg.update-grub-old
+fi
exec grub-mkconfig -o /boot/grub/grub.cfg