LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Suggestion for UPGRADE.TXT (point 5: Fix your config files.) (https://www.linuxquestions.org/questions/slackware-14/suggestion-for-upgrade-txt-point-5-fix-your-config-files-4175693437/)

andrew.46 04-10-2021 12:55 AM

Suggestion for UPGRADE.TXT (point 5: Fix your config files.)
 
I have a very small suggestion, with the upcoming Slackware 15 release, for point 5 in the file UPGRADE.TXT. This section deals with moving over config files with the '.new' extension. There is a small script suggested which copies files over and leaves a '.bak' backup behind. Just to refresh people's minds the script is as follows:

Code:

#!/bin/sh

cd /etc

find . -name "*.new" | while read configfile ; do
if [ ! "$configfile" = "./rc.d/rc.inet1.conf.new" \
-a ! "$configfile" = "./rc.d/rc.local.new" \
-a ! "$configfile" = "./group.new" \
-a ! "$configfile" = "./passwd.new" \
-a ! "$configfile" = "./shadow.new" ]; then
cp -a $(echo $configfile | rev | cut -f 2- -d . | rev) \
$(echo $configfile | rev | cut -f 2- -d . | rev).bak 2> /dev/null
mv --verbose $configfile $(echo $configfile | rev | cut -f 2- -d . | rev)
fi
done

There are of course some sensible exclusions there and my suggestion is that the following file could be added to these:

Code:

-a ! "$configfile" = "./rc.d/rc.modules.local.new" \
Through my own blind use of this script (great script but stupid user) I inadvertently stopped DKMS module rebuilding my NVidia driver whenever I changed kernels. Fixed on my own system with the above line (and restored from the .bak file) but perhaps this might be a useful addition?

Mind you I guess the script could exclude all files in /etc that have the suffix '.local.new'?


All times are GMT -5. The time now is 12:59 AM.