summaryrefslogtreecommitdiffstats
path: root/patches/source/grub/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'patches/source/grub/doinst.sh')
-rw-r--r--patches/source/grub/doinst.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/patches/source/grub/doinst.sh b/patches/source/grub/doinst.sh
new file mode 100644
index 000000000..20b6c34e2
--- /dev/null
+++ b/patches/source/grub/doinst.sh
@@ -0,0 +1,16 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/grub.d/40_custom.new
+rm -f etc/grub.d/40_custom.new
+config etc/default/grub.new