]> git.ipfire.org Git - thirdparty/squid.git/blame - scripts/remove-cfg.sh
Source Format Enforcement (#532)
[thirdparty/squid.git] / scripts / remove-cfg.sh
CommitLineData
e2b88def 1#!/bin/sh
a151895d 2#
77b1029d 3## Copyright (C) 1996-2020 The Squid Software Foundation and contributors
a151895d
AJ
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##
e2b88def
AR
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
14remover=$1 # the program to remove a file
15prime=$2 # the configuration file to be removed, including path
16default=$3 # the default configuration filename, including path
17
18# by default, use .default default extension
19if test -z "$default"
20then
21 default="$prime.default"
22fi
23
24# is the primary configuration file present?
25if test -f $prime
26then
27 # is the primary config identical to the default?
eb192be9 28 if diff $default $prime > /dev/null
e2b88def
AR
29 then
30 echo " $remover -f $prime";
31 $remover -f $prime;
32 fi
33fi
34
35exit 0