LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-10-2021, 12:55 AM   #1
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,214

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
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'?

Last edited by andrew.46; 04-10-2021 at 01:20 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] awk question - read in txt files, offset data by given amount, output new txt files pomico Programming 19 09-17-2012 11:43 AM
Copy the contents of a txt file to other txt files (with similar names) by cp command TheIndependentAquarius Linux - Newbie 7 07-03-2010 12:54 AM
Gnome Desktop makes 10 point font look like 64 point - how do I fix it? TonyC Linux - Desktop 5 03-03-2009 12:22 AM
cat onelinefile.txt >> newfile.txt; cat twofile.txt >> newfile.txt keep newline? tmcguinness Programming 4 02-12-2009 06:38 AM
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration