]> git.ipfire.org Git - thirdparty/squid.git/blob - scripts/remove-cfg.sh
SourceFormat Enforcement
[thirdparty/squid.git] / scripts / remove-cfg.sh
1 #!/bin/sh
2 #
3 ## Copyright (C) 1996-2015 The Squid Software Foundation and contributors
4 ##
5 ## Squid software is distributed under GPLv2+ license and includes
6 ## contributions from numerous individuals and organizations.
7 ## Please see the COPYING and CONTRIBUTORS files for details.
8 ##
9
10 # Removes an configuration file if it is identical to the default file,
11 # preventing "make distcheck" failures due to configuration leftovers.
12 # Intended to be used for installed configuration files.
13
14 remover=$1 # the program to remove a file
15 prime=$2 # the configuration file to be removed, including path
16 default=$3 # the default configuration filename, including path
17
18 # by default, use .default default extension
19 if test -z "$default"
20 then
21 default="$prime.default"
22 fi
23
24 # is the primary configuration file present?
25 if test -f $prime
26 then
27 # is the primary config identical to the default?
28 if diff $default $prime > /dev/null
29 then
30 echo " $remover -f $prime";
31 $remover -f $prime;
32 fi
33 fi
34
35 exit 0