Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/ config protection assistant
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Aquarion
n00b
n00b


Joined: 25 Feb 2003
Posts: 2
Location: UK

PostPosted: Thu Feb 27, 2003 10:52 am    Post subject: /etc/ config protection assistant Reply with quote

A quick script you may find useful in helping keep track of config file changes. When run, will go though /etc and help you to decide on whether to keep or kill a given config file change.

Save this somewhere, and make it executable (I called it "emerge-config-update" and saved it in /usr/sbin. YMMV)

Note: This won't delete or change anything until you tell it to. Use is at your own risk.

Code:
# 2002-02-27/(c)aquarion@aquarionics.com. Released under GPL, use with care.
                                                                                                         
for file in `find /etc -iname '._cfg????_*'`;
        do ORIG=`echo $file | sed -e"s/\._cfg0000_//"`;
        clear
        echo $file to $ORIG:;
        diff $ORIG $file | more ;
        echo -n "Replace $ORIG? (y)es/(n)o/(N)O, and delete the bloody thing>";
        read REP;
        if [ "$REP" = "y" ];
                then cp $ORIG $ORIG.last;
                then mv $file $ORIG;
        fi;
        if [ "$REP" = "N" ];
                then rm ._cfg0000_*;
        fi;
done
Back to top
View user's profile Send private message
sibbe
n00b
n00b


Joined: 31 Jan 2003
Posts: 35
Location: Helsinki, Finland

PostPosted: Thu Feb 27, 2003 1:33 pm    Post subject: Reply with quote

Well, there is already /usr/sbin/etc-update, which also has an option for merging different file versions. Nice to see alternative ways though - I personally like to use the needed tools manually: find -iname "._cfg*" and then diff(1)ing the files & editing.

BTW, etc-update is _almost_ like FreeBSD's mergemaster, so it makes us BSD users feel a little more like home.
_________________
jyrki muukkonen
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum