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