Created
February 25, 2011 04:54
-
-
Save phunehehe/843374 to your computer and use it in GitHub Desktop.
In Gentoo, after updating you may see the message "IMPORTANT: <number> config files in '/etc' need updating.". This script looks for all the files that need to be updated, then overwrite old config files with new ones. Useful when there are a lot of new c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# Update: There is no point using this, we have `etc-update' | |
for new_config in $(find /etc/ -name '._cfg????_*') | |
do | |
old_config=$(echo $new_config | sed 's:\([a-zA-Z0-9]*\)\._cfg[0-9]\{4\}_\([a-zA-Z0-9]*\):\1\2:') | |
if [[ -f "$new_config" || -f "$old_config" ]] | |
then | |
mv $new_config $old_config | |
else | |
echo "Something is wrong with $new_config ." | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment