Modifications to use the new mmlimitrate(3) API
[mmondor.git] / mmsoftware / mmmail / install.sh
1 #!/bin/sh
2 # $Id: install.sh,v 1.6 2003/10/23 01:01:27 mmondor Exp $
3
4 if [ "$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
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.'
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
56 fi
57
58 # Set defaults if not set
59 if [ -z "$MMLAUNCH" ]; then
60 export MMLAUNCH='FALSE'
61 fi
62 if [ -z "$MMPREFIX" ]; then
63 export MMPREFIX='/usr/local'
64 fi
65 if [ -z "$MMCONFDIR" ]; then
66 export MMCONFDIR='/etc'
67 fi
68 if [ -z "$MMDEFAULTUSER" ]; then
69 export MMDEFAULTUSER='0'
70 fi
71 if [ -z "$MMDEFAULTGROUP" ]; then
72 export MMDEFAULTGROUP='0'
73 fi
74 if [ -z "$MMADMINGROUP" ]; then
75 export MMADMINGROUP='staff'
76 fi
77 if [ -z "$MMSTATDIR" ]; then
78 export MMSTATDIR='/var/mmstatd'
79 fi
80 if [ -z "$MMSTATDUSER" ]; then
81 export MMSTATDUSER='mmstatd'
82 fi
83 if [ -z "$MMSTATDGROUP" ]; then
84 export MMSTATDGROUP='mmstat'
85 fi
86 if [ -z "$MMMAILUSER" ]; then
87 export MMMAILUSER='mmmail'
88 fi
89 if [ -z "$MMMAILGROUP" ]; then
90 export MMMAILGROUP='mmmail'
91 fi
92
93 . ../mmlib/makefuncs.sh
94
95 instgroup $MMADMINGROUP
96
97 cd ../mmlib/
98 instman mmfd.3 3
99 instman mmlist.3 3
100 instman mmpool.3 3
101 instman mmstat.3 3
102 instman mmhash.3 3
103 instman mmlimitrate.3 3
104 cd ../
105
106 cd mmpasswd/
107 instbin mmpasswd 750 $MMADMINGROUP
108 instman mmpasswd.8 8
109 cd ../
110
111 cd mmstatd/src/
112 instuser $MMSTATDUSER $MMSTATDGROUP
113 killbin mmstatd
114 instbin mmstatd 700
115 instbin mmstat 750 $MMADMINGROUP
116 instman mmstat.8 8
117 instman mmstatd.8 8
118 instman mmstatd.conf.5 5
119 cd ../etc/
120 instconf mmstatd.conf 640 $MMSTATDGROUP
121 instdir $MMSTATDIR 750 $MMSTATDUSER $MMSTATDGROUP
122 if [ "$MMLAUNCH" = "TRUE" ]; then
123 startbin mmstatd $MMCONFDIR/mmstatd.conf
124 fi
125 cd ../../
126
127 cd mmmail/src/mmsmtpd/
128 instuser $MMMAILUSER $MMMAILGROUP
129 killbin mmsmtpd
130 instbin mmsmtpd 700
131 instman mmsmtpd.8 8
132 instman mmsmtpd.conf.5 5
133 cd ../mmpop3d
134 killbin mmpop3d
135 instbin mmpop3d 700
136 instman mmpop3d.8 8
137 instman mmpop3d.conf.5 5
138 cd ../../etc
139 instconf mmsmtpd.conf 600
140 instconf mmpop3d.conf 600
141 if [ "$MMLAUNCH" = "TRUE" ]; then
142 startbin mmsmtpd $MMCONFDIR/mmsmtpd.conf
143 startbin mmpop3d $MMCONFDIR/mmpop3d.conf
144 fi
145 cd ../src
146 instman mmmail.8 8
147 cd ../../
148
149 echo
150 echo "*** Please read the following man pages ***"
151 echo
152 echo "mmstat(8), mmstatd(8), mmstatd.conf(5) mmpasswd(8)"
153 echo "mmmail(8), mmsmtpd(8), mmsmtpd.conf(5), mmpop3d(8) mmpop3d.conf(5)"
154 echo "source auditors: mmstat(3), mmfd(3), mmlist(3), mmpool(3), mmhash(3),"
155 echo " mmlimitrate(3)"
156 echo
157 echo "Thank you for using mmsoftware."
158 echo