mmlib/mmat: replace some variables by literal constants
[mmondor.git] / mmsoftware / mmmail / install.sh
CommitLineData
47071c2b 1#!/bin/sh
da634739 2# $Id: install.sh,v 1.6 2003/10/23 01:01:27 mmondor Exp $
5eb34fba
MM
3
4if [ "$1" = "help" ]; then
5 echo
6 echo 'You can optionally set the following environment variables'
7 echo 'to customize the installation process. For each is shown an'
8 echo 'example using the default value followed by a breif description.'
9 echo
1a5bbe01
MM
10 echo 'export MMLAUNCH="TRUE"'
11 echo ' Tells the install process to immediately launch the daemon(s)'
12 echo ' They are automatically killed before the binaries are copied'
13 echo ' over the old ones as is necessary with some systems. The'
14 echo ' default is to not start them back automatically.'
5eb34fba
MM
15 echo
16 echo 'export MMPREFIX="/usr/local"'
17 echo ' Allows to set the installation base directory. All files but'
18 echo ' configuration ones will be installed in directories relative'
19 echo ' to this one.'
20 echo
21 echo 'export MMCONFDIR="/etc"'
22 echo ' Directory in which configuration files should be stored.'
23 echo
24 echo 'export MMDEFAULTUSER="0"'
25 echo ' User new files and directories should be owned by, using'
26 echo ' user id or name.'
27 echo
28 echo 'export MMDEFAULTGROUP="0"'
29 echo ' Group new files and directories should be under, using id'
30 echo ' or name.'
31 echo
32 echo 'export MMADMINGROUP="staff"'
33 echo ' The administrators group, these can for instance view and the'
34 echo ' rotate mmstat statistics and execute mmpasswd. Will be'
35 echo ' created automatically if necessary.'
36 echo
37 echo 'export MMSTATDIR="/var/mmstatd"'
38 echo ' The directory in which mmstatd will store the stats database'
39 echo ' and log files.'
40 echo
41 echo 'export MMSTATDUSER="mmstatd"'
42 echo ' The user mmstatd will run under, to be automatically created.'
43 echo
44 echo 'export MMSTATDGROUP="mmstat"'
45 echo ' Group the mmstatd user should be part of, automatically'
46 echo ' created.'
47 echo
48 echo 'export MMMAILUSER="mmmail"'
49 echo ' The user mmmail daemons should run under, will be created'
50 echo ' automatically if nonexisting.'
51 echo
52 echo 'export MMMAILGROUP="mmmail"'
53 echo ' Group the mmmail user should be part of. Created if needed.'
54 echo
55 exit
56fi
57
58# Set defaults if not set
59if [ -z "$MMLAUNCH" ]; then
1a5bbe01 60 export MMLAUNCH='FALSE'
5eb34fba
MM
61fi
62if [ -z "$MMPREFIX" ]; then
63 export MMPREFIX='/usr/local'
64fi
65if [ -z "$MMCONFDIR" ]; then
66 export MMCONFDIR='/etc'
67fi
68if [ -z "$MMDEFAULTUSER" ]; then
69 export MMDEFAULTUSER='0'
70fi
71if [ -z "$MMDEFAULTGROUP" ]; then
72 export MMDEFAULTGROUP='0'
73fi
74if [ -z "$MMADMINGROUP" ]; then
75 export MMADMINGROUP='staff'
76fi
77if [ -z "$MMSTATDIR" ]; then
78 export MMSTATDIR='/var/mmstatd'
79fi
80if [ -z "$MMSTATDUSER" ]; then
81 export MMSTATDUSER='mmstatd'
82fi
83if [ -z "$MMSTATDGROUP" ]; then
84 export MMSTATDGROUP='mmstat'
85fi
86if [ -z "$MMMAILUSER" ]; then
87 export MMMAILUSER='mmmail'
88fi
89if [ -z "$MMMAILGROUP" ]; then
90 export MMMAILGROUP='mmmail'
91fi
47071c2b
MM
92
93. ../mmlib/makefuncs.sh
94
5eb34fba 95instgroup $MMADMINGROUP
47071c2b
MM
96
97cd ../mmlib/
98instman mmfd.3 3
99instman mmlist.3 3
7a56f31f 100instman mmpool.3 3
47071c2b 101instman mmstat.3 3
904cd663 102instman mmhash.3 3
da634739 103instman mmlimitrate.3 3
47071c2b
MM
104cd ../
105
106cd mmpasswd/
5eb34fba 107instbin mmpasswd 750 $MMADMINGROUP
47071c2b
MM
108instman mmpasswd.8 8
109cd ../
110
111cd mmstatd/src/
5eb34fba 112instuser $MMSTATDUSER $MMSTATDGROUP
47071c2b
MM
113killbin mmstatd
114instbin mmstatd 700
5eb34fba 115instbin mmstat 750 $MMADMINGROUP
47071c2b
MM
116instman mmstat.8 8
117instman mmstatd.8 8
118instman mmstatd.conf.5 5
119cd ../etc/
5eb34fba
MM
120instconf mmstatd.conf 640 $MMSTATDGROUP
121instdir $MMSTATDIR 750 $MMSTATDUSER $MMSTATDGROUP
122if [ "$MMLAUNCH" = "TRUE" ]; then
123 startbin mmstatd $MMCONFDIR/mmstatd.conf
124fi
47071c2b
MM
125cd ../../
126
127cd mmmail/src/mmsmtpd/
5eb34fba 128instuser $MMMAILUSER $MMMAILGROUP
47071c2b
MM
129killbin mmsmtpd
130instbin mmsmtpd 700
131instman mmsmtpd.8 8
132instman mmsmtpd.conf.5 5
133cd ../mmpop3d
134killbin mmpop3d
135instbin mmpop3d 700
136instman mmpop3d.8 8
137instman mmpop3d.conf.5 5
138cd ../../etc
139instconf mmsmtpd.conf 600
140instconf mmpop3d.conf 600
5eb34fba
MM
141if [ "$MMLAUNCH" = "TRUE" ]; then
142 startbin mmsmtpd $MMCONFDIR/mmsmtpd.conf
143 startbin mmpop3d $MMCONFDIR/mmpop3d.conf
144fi
145cd ../src
47071c2b
MM
146instman mmmail.8 8
147cd ../../
148
149echo
150echo "*** Please read the following man pages ***"
151echo
5eb34fba
MM
152echo "mmstat(8), mmstatd(8), mmstatd.conf(5) mmpasswd(8)"
153echo "mmmail(8), mmsmtpd(8), mmsmtpd.conf(5), mmpop3d(8) mmpop3d.conf(5)"
da634739
MM
154echo "source auditors: mmstat(3), mmfd(3), mmlist(3), mmpool(3), mmhash(3),"
155echo " mmlimitrate(3)"
47071c2b
MM
156echo
157echo "Thank you for using mmsoftware."
158echo