Question on script for .new files from UPGRADE.TXT
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Question on script for .new files from UPGRADE.TXT
Hi all,
I'm upgrading Slackware from 12 to 12.1 and things have gone pretty well. I'm at the point where I need to work with the .new configuration files and I've got a question.
The UPGRADE.TXT file says:
Quote:
Fix your config files. Some of the config files in /etc are going to need your attention. You'll find the new incoming config files on your system with the ".new" extension. You may need to fill these in with information from your old config files and then move them over.
Feel brave? You can use this little script to install all of the .new config files in /etc. If you've made any local changes you'll need to add them to the newly installed files. Your old config files will be copied to *.bak. Anyway, it might be an easier starting point. Here it is:
Code:
#!/bin/sh
cd /etc
find . -name "*.new" | while read configfile ; do
if [ ! "$configfile" = "./rc.d/rc.inet1.conf.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 $configfile $(echo $configfile | rev | cut -f 2- -d . | rev)
fi
done
My script-reading skills are still pretty shaky. Does this script just move the rc.inet1.conf, group, passwd, and shadow files, or does it NOT move those files?
Will this script find all the .new files and install them?
if [ ! "$configfile" = "./rc.d/rc.inet1.conf.new" \
-a ! "$configfile" = "./group.new" \
-a ! "$configfile" = "./passwd.new" \
-a ! "$configfile" = "./shadow.new" ]; then
Basically it reads:
if whatever.new doesn't equal group, passwd, shadow or rc.inet1.conf then give the originals a .bak extension and then rename the new ones so they don't have a .new extension.
So it leaves those for your manual attention. The "!" is telling it to exclude those files. Remove that and then it will only handle those files.
You should also note that if you made any changes to the original 12.0 files, you will have to add those changes to the new 12.1 files. After running that script, the 12.1 config files will have the proper names and your 12.0 files will have *.bak names -- you can look through the .bak files (`find /etc -name *.bak` should show you all of the .bak files created) and add your changes to the new files (without the .bak extensions).
You should also note that if you made any changes to the original 12.0 files, you will have to add those changes to the new 12.1 files. After running that script, the 12.1 config files will have the proper names and your 12.0 files will have *.bak names -- you can look through the .bak files (`find /etc -name *.bak` should show you all of the .bak files created) and add your changes to the new files (without the .bak extensions).
Thanks. I figured that was the point, but I was worried that the group, shadow, and passwd files would be changed.
When I add things to my configuration files, I usually put in a comment like:
You might also want to read HowTo Upgrade Slackware 12.0 to 12.1 and pay particular attention to the notes about the config files (such as those under /etc/modprobe.d).
Sorry to butt in on this thread, but I have a question that seems relevant.
The passwd and group files have users and groups that you have created, how should these be handled when you upgrade. should the passwd.new be renamed to passwd, and any users you setup in your original passwd file just be copied over to the new passwd file?
Thats what I did on my upgrade but I'm not sure if thats right. It seems to have worked
Sorry to butt in on this thread, but I have a question that seems relevant.
The passwd and group files have users and groups that you have created, how should these be handled when you upgrade. should the passwd.new be renamed to passwd, and any users you setup in your original passwd file just be copied over to the new passwd file?
Thats what I did on my upgrade but I'm not sure if thats right. It seems to have worked
The new group and passwd files would only be useful if there were some new groups or users needed for some new feature, and something like that would have been mentioned in CHANGES_AND_HINTS.TXT. It wasn't so they were removed promptly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.