| 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 | |
| 8 | scripts=../scripts |
| 9 | |
| 10 | # First off, get the OS type, and check that there is a make file for it. |
| 11 | |
| 12 | os=`$scripts/os-type -generic` || exit 1 |
| 13 | |
| 14 | if test ! -r ../OS/Makefile-$os |
| 15 | then 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; |
| 20 | fi |
| 21 | |
| 22 | # We also need the architecture type, in order to test for any architecture- |
| 23 | # specific configuration files. |
| 24 | |
| 25 | arch=`$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 | |
| 33 | echo "#!/bin/sh" > eximon |
| 34 | chmod a+x eximon |
| 35 | |
| 36 | # Concatenate the configuration files that exist |
| 37 | |
| 38 | for 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 |
| 44 | do 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 |
| 50 | done >> eximon || exit 1 |
| 51 | |
| 52 | # End of Configure-eximon |