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