Modifications to use the new mmlimitrate(3) API
[mmondor.git] / mmsoftware / install.sh
CommitLineData
47071c2b 1#!/bin/sh
da634739 2# $Id: install.sh,v 1.9 2003/10/23 01:01:15 mmondor Exp $
47071c2b
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 15 echo
47071c2b
MM
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 MMFTPDUSER="mmftpd"'
49 echo ' The user mmftpd will run under, to be automatically created.'
50 echo
51 echo 'export MMFTPDGROUP="mmftpd"'
52 echo ' Group the mmftpd user should be part of, automatically'
53 echo ' created. The mmftpdpasswd configuration file will be readable'
54 echo ' by this group.'
55 echo
56 echo 'export MMMAILUSER="mmmail"'
57 echo ' The user mmmail daemons should run under, will be created'
58 echo ' automatically if nonexisting.'
59 echo
60 echo 'export MMMAILGROUP="mmmail"'
61 echo ' Group the mmmail user should be part of. Created if needed.'
62 echo
63 exit
64fi
65
66# Set defaults if not set
5eb34fba 67if [ -z "$MMLAUNCH" ]; then
1a5bbe01 68 export MMLAUNCH='FALSE'
5eb34fba 69fi
47071c2b
MM
70if [ -z "$MMPREFIX" ]; then
71 export MMPREFIX='/usr/local'
72fi
73if [ -z "$MMCONFDIR" ]; then
74 export MMCONFDIR='/etc'
75fi
76if [ -z "$MMDEFAULTUSER" ]; then
77 export MMDEFAULTUSER='0'
78fi
79if [ -z "$MMDEFAULTGROUP" ]; then
80 export MMDEFAULTGROUP='0'
81fi
82if [ -z "$MMADMINGROUP" ]; then
83 export MMADMINGROUP='staff'
84fi
85if [ -z "$MMSTATDIR" ]; then
86 export MMSTATDIR='/var/mmstatd'
87fi
88if [ -z "$MMSTATDUSER" ]; then
89 export MMSTATDUSER='mmstatd'
90fi
91if [ -z "$MMSTATDGROUP" ]; then
92 export MMSTATDGROUP='mmstat'
93fi
94if [ -z "$MMFTPDUSER" ]; then
95 export MMFTPDUSER='mmftpd'
96fi
97if [ -z "$MMFTPDGROUP" ]; then
98 export MMFTPDGROUP='mmftpd'
99fi
100if [ -z "$MMMAILUSER" ]; then
101 export MMMAILUSER='mmmail'
102fi
103if [ -z "$MMMAILGROUP" ]; then
104 export MMMAILGROUP='mmmail'
105fi
106
107. mmlib/makefuncs.sh
108
109instgroup $MMADMINGROUP
110
111cd mmlib/
112instman mmfd.3 3
113instman mmfifo.3 3
4f87c15b 114instman mmlifo.3 3
47071c2b 115instman mmlist.3 3
7a56f31f 116instman mmpool.3 3
47071c2b
MM
117instman mmpath.3 3
118instman mmstat.3 3
904cd663 119instman mmhash.3 3
da634739 120instman mmlimitrate.3 3
47071c2b 121cd ../
b687a849
MM
122cd apache-mmstat/
123instman apache-mmstat.8 8
124cd ../
47071c2b
MM
125
126cd mmpasswd/
127instbin mmpasswd 750 $MMADMINGROUP
128instman mmpasswd.8 8
129cd ../
130
131cd mmstatd/src/
132instuser $MMSTATDUSER $MMSTATDGROUP
133killbin mmstatd
134instbin mmstatd 700
135instbin mmstat 750 $MMADMINGROUP
136instman mmstat.8 8
137instman mmstatd.8 8
138instman mmstatd.conf.5 5
139cd ../etc/
140instconf mmstatd.conf 640 $MMSTATDGROUP
141instdir $MMSTATDIR 750 $MMSTATDUSER $MMSTATDGROUP
5eb34fba
MM
142if [ "$MMLAUNCH" = "TRUE" ]; then
143 startbin mmstatd $MMCONFDIR/mmstatd.conf
144fi
47071c2b 145cd ../../
b687a849
MM
146cd apache-mmstat/
147instbin apache-mmstat 700
148cd ../
47071c2b
MM
149
150cd mmftpd/src/
151instuser $MMFTPDUSER $MMFTPDGROUP
152killbin mmftpd
153instbin mmftpd 700
154instman mmftpd.8 8
155instman mmftpd.conf.5 5
156instman mmftpdpasswd.5 5
157cd ../etc/
158instconf mmftpd.conf 600
159instconf mmftpdpasswd 640 $MMFTPDGROUP
5eb34fba
MM
160if [ "$MMLAUNCH" = "TRUE" ]; then
161 startbin mmftpd $MMCONFDIR/mmftpd.conf
162fi
47071c2b
MM
163cd ../../
164
165cd mmmail/src/mmsmtpd/
166instuser $MMMAILUSER $MMMAILGROUP
167killbin mmsmtpd
168instbin mmsmtpd 700
169instman mmsmtpd.8 8
170instman mmsmtpd.conf.5 5
171cd ../mmpop3d
172killbin mmpop3d
173instbin mmpop3d 700
174instman mmpop3d.8 8
175instman mmpop3d.conf.5 5
176cd ../../etc
177instconf mmsmtpd.conf 600
178instconf mmpop3d.conf 600
5eb34fba
MM
179if [ "$MMLAUNCH" = "TRUE" ]; then
180 startbin mmsmtpd $MMCONFDIR/mmsmtpd.conf
181 startbin mmpop3d $MMCONFDIR/mmpop3d.conf
182fi
47071c2b
MM
183cd ../src
184instman mmmail.8 8
185cd ../../
186
187echo
188echo "*** Please read the following man pages ***"
189echo
b687a849
MM
190echo "all users: mmstat(8), mmstatd(8), mmstatd.conf(5), mmpasswd(8),"
191echo " apache-mmstat(8)"
47071c2b
MM
192echo "mmftpd users: mmftpd(8), mmftpd.conf(5), mmftpdpasswd(5)"
193echo "mmmail users: mmmail(8), mmsmtpd(8), mmsmtpd.conf(5), mmpop3d(8),"
194echo " mmpop3d.conf(5)"
7a56f31f 195echo "source auditors: mmstat(3), mmfd(3), mmlist(3), mmpool(3), mmfifo(3),"
da634739 196echo " mmlifo(3), mmpath(3), mmhash(3), mmlimitrate(3)"
47071c2b
MM
197echo
198echo "Thank you for using mmsoftware."
199echo