[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Modified Config Files



Chris Stork wrote:

>What would be an easy way to list the config files that have been 
>changed on my system?

I use the following script I wrote some time ago. It uses the file in
/var/lib/dpkg/info to determine which files are conffiles (*.conffiles)
and what the md5sum of the file was as distributed (*.md5sums). Any
conffiles that differ are printed out (with a leading M - cvs style).

Unfortunately it is not as useful as I had hope it would be because a
lot of packages do not ship with a .md5sums file in /var/lib/dpkg/info
so there's no way to tell if a file has changed from how it was
distributed. These conffiles are printed with a leading ? - cvs style.

------cut here------
#!/bin/bash

cd /var/lib/dpkg/info
for n in *.conffiles ; do
  pkg="${n%%.conffiles}"
  m="$pkg.md5sums"
  if [ -f "$m" ] ; then 
    sort "$n" | ( 
      sort -k 2 "$m" | sed 's!  !:/!' | join -t : -2 2 -o 2.1,0 /dev/fd/3 -
    ) 3</dev/fd/0 | tr : ' ' | while read s f ; do
      [ -f "$f" ] && [ "$(md5sum "$f" | awk '{print $1}')" != "$s" ] && echo "M $f"
    done
  else
    sed 's/^/? /' $n
  fi
done
------cut here------



Reply to: