Reimplementation.
[etcdiff.git] / etcdiff.sh
1 #!/bin/sh
2 #
3 # etcdiff (deb-etcdiff?) shows how your current /etc dir
4 # diverges from the debian distribution standard one.
5 #
6 # Copyright (C) 2008,2009,2010 Antonio Ospite <ospite@studenti.unina.it>
7 # License: GPLv2 or later
8 #
9 #set -x
10 #set -e
11
12 PROMPT_RM=-i
13
14 DEBIANMIRROR="http://ftp.it.debian.org/debian"
15
16 BASEDIR=$(dirname $0)
17 TEMPDIR=${BASEDIR}/temp
18 CACHEDIR=${BASEDIR}/cache
19 REPORTDIR=${BASEDIR}/reports
20
21 rm $PROMPT_RM -rf $TEMPDIR   && mkdir $TEMPDIR
22 rm $PROMPT_RM -rf $CACHEDIR  && mkdir $CACHEDIR
23 rm $PROMPT_RM -rf $REPORTDIR && mkdir $REPORTDIR
24
25 . $BASEDIR/etcdiff.include
26
27 # Examples of file query
28
29 # by explicit file list
30 #FILES="/etc/sysctl.conf /etc/updatedb.conf"
31 #for file in $FILES;
32 #do
33 #  etcdiff_by_file $file
34 #done
35
36 # by file list generated by a command
37 #FILES=$(find /etc/apache2 -type f -perm /o+r | grep -v '.dpkg-')
38 #for file in $FILES;
39 #do
40 #  etcdiff_by_file $file
41 #done
42
43 # by package name
44 #etcdiff_by_package cherokee
45 #etcdiff_by_package mlocate
46 #etcdiff_by_package apache2-doc
47 #etcdiff_by_package apache2.2-common
48 #etcdiff_by_package libapache2-mod-php5
49 #etcdiff_by_package hostapd
50
51 #etchdiff_system