diff options
Diffstat (limited to 'source/a/module-init-tools/doinst.sh')
-rw-r--r-- | source/a/module-init-tools/doinst.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/a/module-init-tools/doinst.sh b/source/a/module-init-tools/doinst.sh new file mode 100644 index 00000000..41ff1d75 --- /dev/null +++ b/source/a/module-init-tools/doinst.sh @@ -0,0 +1,22 @@ +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/modprobe.conf.new + +# Retain legacy behavior by tossing a symlink in /etc/modprobe.d/: +# Note that the plan is to eliminate /etc/modprobe.conf and +# /etc/modules.conf in the long run, so you may wish to remove the +# link and move your actual file into /etc/modprobe.d/ if you want +# to keep it instead of going with smaller chunks in there... +if [ -r etc/modprobe.conf ]; then + ( cd etc/modprobe.d ; ln -s ../modprobe.conf . 2> /dev/null ) +fi + |