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