updated on Sun Jan 22 08:00:21 UTC 2012
[aur-mirror.git] / qmail / qmail-rhconfig
blob472747f58e75a093c8d3780cbc6b47a845d7286e
1 #!/bin/bash
3 # This file sets up the qmail config files on a RedHat system using
4 # default values gleaned from the system itself. This script is
5 # intended to replace the "config" script included with qmail itself.
8 set -e
9 cd ${1:-/var/qmail/control}
10 makefile() {
11 file="$1"
12 shift
13 if ! [ -e "$file" -a -s "$file" ]; then
14 tr A-Z a-z >"$file"
15 chmod 644 "$file"
16 else
17 cat > /dev/null
21 hostname=`/bin/hostname -f`
22 domainname=`/bin/domainname -d`
24 echo $hostname | makefile me
25 echo $domainname | makefile defaultdomain
26 echo $domainname | makefile defaulthost
29 echo localhost
30 echo $hostname
31 ipmeprint | (
32 while read ip; do
33 if str=`ipcalc --hostname $ip 2>/dev/null`; then
34 eval $str
35 echo $HOSTNAME
37 done
39 ) | sort -u | makefile locals
41 cat locals | makefile rcpthosts