b6c05439a319b2b6f6808641b6103304f24cea8e
[mmondor.git] / mmsoftware / mmftpd / install.sh
1 #!/bin/sh
2 # $Id: install.sh,v 1.6 2003/06/18 01:15: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 cd ../
107
108 cd mmpasswd/
109 instbin mmpasswd 750 $MMADMINGROUP
110 instman mmpasswd.8 8
111 cd ../
112
113 cd mmstatd/src/
114 instuser $MMSTATDUSER $MMSTATDGROUP
115 killbin mmstatd
116 instbin mmstatd 700
117 instbin mmstat 750 $MMADMINGROUP
118 instman mmstat.8 8
119 instman mmstatd.8 8
120 instman mmstatd.conf.5 5
121 cd ../etc/
122 instconf mmstatd.conf 640 $MMSTATDGROUP
123 instdir $MMSTATDIR 750 $MMSTATDUSER $MMSTATDGROUP
124 if [ "$MMLAUNCH" = "TRUE" ]; then
125 startbin mmstatd $MMCONFDIR/mmstatd.conf
126 fi
127 cd ../../
128
129 cd mmftpd/src/
130 instuser $MMFTPDUSER $MMFTPDGROUP
131 killbin mmftpd
132 instbin mmftpd 700
133 instman mmftpd.8 8
134 instman mmftpd.conf.5 5
135 instman mmftpdpasswd.5 5
136 cd ../etc/
137 instconf mmftpd.conf 600
138 instconf mmftpdpasswd 640 $MMFTPDGROUP
139 if [ "$MMLAUNCH" = "TRUE" ]; then
140 startbin mmftpd $MMCONFDIR/mmftpd.conf
141 fi
142 cd ../../
143
144 echo
145 echo "*** Please read the following man pages ***"
146 echo
147 echo "mmstat(8), mmstatd(8), mmstatd.conf(5) mmpasswd(8)"
148 echo "mmftpd(8), mmftpd.conf(5), mmftpdpasswd(5)"
149 echo "source auditors: mmstat(3), mmfd(3), mmlist(3), mmpool(3), mmfifo(3),"
150 echo " mmpath(3), mmhash(3)"
151 echo
152 echo "Thank you for using mmsoftware."
153 echo