forked from DanRohde/webdavcgi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheckenv
executable file
·105 lines (84 loc) · 3.03 KB
/
checkenv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
#########################################################################
# (C) ZE CMS, Humboldt-Universitaet zu Berlin
# Written 2010-2014 by Daniel Rohde <[email protected]>
#########################################################################
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#########################################################################
MODULES='CGI DBI POSIX File::Temp Date::Parse UUID::Tiny XML::Simple Quota Archive::Zip IO::Compress::Gzip IO::Compress::Deflate Digest::MD5 Module::Load JSON File::Copy::Link DateTime DateTime::Format::Human::Duration URI::Escape IO::Compress::Brotli'
OPTIONALMODULES='DBD::SQLite DBD::mysql DBD::Pg MIME::Entity'
FSBACKENDMODULES='File::Spec::Link'
AFSBACKENDMODULES=$FSBACKENDMODULES
GFSBACKENDMODULES=$FSBACKENDMODULES
SMBBACKENDMODULES='Filesys::SmbClient'
RCSBACKENDMODULES='Rcs'
WEBINTERFACEMODULES='Graphics::Magick URI::Escape'
OPTIONALBINARIES='smbclient pagsh kinit aklog soffice'
CHECKEDMODULES=""
MISSINGMODULES=""
MISSINGBINARIES=""
mcheck() {
for module in $@ ; do
if ( echo $CHECKEDMODULES | grep -qw $module ) ; then
echo " $module already checked"
continue
fi
out=$(perl -M$module -e 'print "installed"' 2>&1)
if test $? -ne 0 ; then
out='---- NOT INSTALLED ----'
MISSINGMODULES="$MISSINGMODULES $module"
fi
CHECKEDMODULES="$CHECKEDMODULES $module"
echo " $module $out"
done
}
bcheck() {
for binary in $@ ; do
out=$(which $binary)
if test $? -ne 0 ; then
out='--- NOT INSTALLED ----'
MISSINGBINARIES="$MISSINGBINARIES $binary"
fi
echo " $binary $out"
done
}
echo "+++ Checking perl:"
bcheck perl
echo "++++ Checking required modules:"
mcheck $MODULES
echo "++++ Checking optional modules:"
mcheck $OPTIONALMODULES
echo "++++ Checking required modules for FS backend:"
mcheck $FSBACKENDMODULES
echo "++++ Checking required modules for AFS backend:"
mcheck $AFSBACKENDMODULES
echo "++++ Checking required modules for GFS backend:"
mcheck $GFSBACKENDMODULES
echo "++++ Checking required modules for SMB backend:"
mcheck $SMBBACKENDMODULES
echo "++++ Checking required modules for RCS backend:"
mcheck $RCSBACKENDMODULES
echo "++++ Checking optional binaries:"
bcheck $OPTIONALBINARIES
echo "#### Summary:"
if test "$MISSINGMODULES" != "" ; then
echo "Missing modules: $MISSINGMODULES"
else
echo "All modules found."
fi
if test "$MISSINGBINARIES" != "" ; then
echo "Missing binaries: $MISSINGBINARIES"
else
echo "All binaries found."
fi