Hopefully the final lot of test files.
[exim.git] / src / scripts / Configure-eximon
CommitLineData
61ec970d
PH
1#! /bin/sh
2# $Cambridge: exim/src/scripts/Configure-eximon,v 1.1 2004/10/06 15:07:40 ph10 Exp $
3
4# Shell script to build the configurable part of the Exim monitor's start-up
5# script. This is built from various configuration files. The final part is
6# added in the Makefile, using various macros that are available at that stage.
7
8scripts=../scripts
9
10# First off, get the OS type, and check that there is a make file for it.
11
12os=`$scripts/os-type -generic` || exit 1
13
14if test ! -r ../OS/Makefile-$os
15then echo ""
16 echo "*** Sorry - operating system $os is not supported"
17 echo "*** See OS/Makefile-* for supported systems" 1>&2
18 echo ""
19 exit 1;
20fi
21
22# We also need the architecture type, in order to test for any architecture-
23# specific configuration files.
24
25arch=`$scripts/arch-type` || exit 1
26
27# Build a file called eximon in the current directory by joining
28# the generic default configure file, the OS base configure file, and then
29# local generic, OS-specific, architecture-specific, and OS+architecture-
30# specific configurationfiles, if they exist. These files all contain variable
31# definitions, with later definitions overriding earlier ones.
32
33echo "#!/bin/sh" > eximon
34chmod a+x eximon
35
36# Concatenate the configuration files that exist
37
38for f in OS/eximon.conf-Default \
39 OS/eximon.conf-$os \
40 Local/eximon.conf \
41 Local/eximon.conf-$os \
42 Local/eximon.conf-$arch \
43 Local/eximon.conf-$os-$arch
44do if test -r ../$f
45 then echo "# From $f"
46 sed '/^#/d;/^[ ]*$/d' ../$f || exit 1
47 echo "# End of $f"
48 echo ""
49 fi
50done >> eximon || exit 1
51
52# End of Configure-eximon