summaryrefslogtreecommitdiff
path: root/package/control
blob: 8f2bdf8c61eced292d62071b56c020e5dbfc7dda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

shout() { echo "$0: $@" >&2; }
barf() { shout "fatal: $@"; exit 111; }
safe() { "$@" || barf "cannot $@"; }

here=`env - PATH=$PATH pwd`
mypwd=${here%package}
mypwd=${mypwd%/}
home=`head -1 $mypwd/conf-home`

safe umask 022
[ -d package ] || barf "no package directory"
[ -d command ] || barf "no command directory"
[ -d ctl     ] || barf "no ctl directory"
[ -d $home/control ] || barf "no s/qmail/control directory"

[ -x command/hostname ] || barf "no 'hostname' file"

[ -f $home/control/me ] || \
safe command/hostname > $home/control/me

[ -f $home/control/rcpthosts ] || \
safe command/hostname > $home/control/rcpthosts

[ -f $home/control/tlsdestinations ] || \
safe echo '*:' > $home/control/tlsdestinations

for i in `ls ctl`
do 
  [ -f $home/control/$i ] || safe cp ctl/$i $home/control/
done

shout "s/qmail control files populated."

exit 0