Index: trunk/wikiation/installer/util/installcheck.sh |
— | — | @@ -1,101 +0,0 @@ |
2 | | -#!/bin/bash |
3 | | - |
4 | | - |
5 | | -function checkexist { |
6 | | - |
7 | | - aptitude show $1 | grep "State: installed" >/dev/null && { echo "$1 is installed"; return 0; } || { echo "$1 needs to be installed"; return 1; } |
8 | | -} |
9 | | - |
10 | | - |
11 | | -function pyver { |
12 | | - pythonver=`python -V 2>&1` |
13 | | - echo -n "Found python version $pythonver. " |
14 | | - major=`echo $pythonver | sed "s/^Python //g" | sed "s/\..*$//"` |
15 | | - if [ $major -ne 2 ]; then |
16 | | - if [ $major -eq 3 ]; then |
17 | | - echo "Python 3 is not yet supported" |
18 | | - else |
19 | | - echo "Unknown python version. Please ensure you have python > 2.5.2 or later (but not Python 3)" |
20 | | - fi |
21 | | - return 1 |
22 | | - fi |
23 | | - |
24 | | - minorrevision=`echo $pythonver | sed "s/^Python 2.//g"` |
25 | | - minor=`echo $minorrevision | sed "s/\..*$//"` |
26 | | - revision=`echo $minorrevision | sed "s/^.*\.//"` |
27 | | - if [ $minor -lt 5 ]; then |
28 | | - echo "Default python is not version 2.5. Ensure default python version is 2.5 or later." |
29 | | - return 1 |
30 | | - fi |
31 | | - |
32 | | - if [ $minor -eq 5 -a $revision -lt 2 ]; then |
33 | | - echo "The wikiation installer is only tested with python version 2.5.2 or better, please ensure you have python version 2.5.2 or better installed." |
34 | | - return 1 |
35 | | - fi |
36 | | - |
37 | | - echo "Python version seems ok." |
38 | | - return 0 |
39 | | -} |
40 | | - |
41 | | - |
42 | | -uname -a 2>&1 | grep "Linux" >/dev/null 2>&1 && echo "Linux detected." || { |
43 | | - echo "This isn't Linux."; exit 1; } |
44 | | - |
45 | | -google=`ping -q -c3 -W2 www.google.com 2>&1` |
46 | | -echo $google | grep "unknown host" > /dev/null && { |
47 | | - echo "No DNS available. Is the network available at all? Ensure the network becomes available" |
48 | | - exit 1 |
49 | | -} |
50 | | -echo $google | grep "100% packet loss" > /dev/null && { |
51 | | - echo "Can't ping www.google.com (100% packet loss). Please check your network settings" |
52 | | - exit 1 |
53 | | - } |
54 | | -echo $google | grep "0% packet loss" >/dev/null && echo "Network seems up" |
55 | | - |
56 | | -aptitude --version >/dev/null 2>&1 && echo "aptitude found, continuing" || { |
57 | | - echo "aptitude fails to respond, please ensure your debian environment is sane. (Try something like apt-get update; apt-get install aptitude) "; exit 1; } |
58 | | - |
59 | | -echo " --- " |
60 | | - |
61 | | -locale -a 2>&1 | grep "en_US.utf8" >/dev/null && echo "System supports utf8 locale" || echo "locale en_US.utf8 not installed. Ensure debconf is installed, then run dpkg-reconfigure locales" |
62 | | - |
63 | | -echo " --- " |
64 | | -x=0 |
65 | | -checkexist debconf |
66 | | -x=$(($?|$x)) |
67 | | -checkexist mysql-server-5.0 |
68 | | -x=$(($?|$x)) |
69 | | -checkexist mysql-client-5.0 |
70 | | -x=$(($?|$x)) |
71 | | -checkexist python2.5 && pyver |
72 | | -x=$(($?|$x)) |
73 | | -checkexist php5-cli |
74 | | -x=$(($?|$x)) |
75 | | -checkexist apache2 |
76 | | -x=$(($?|$x)) |
77 | | -checkexist libapache2-mod-php5 |
78 | | -x=$(($?|$x)) |
79 | | -checkexist apache2.2-common |
80 | | -x=$(($?|$x)) |
81 | | -checkexist subversion |
82 | | -x=$(( $?|$x )) |
83 | | -checkexist php5-mysql |
84 | | -x=$(( $?|$x )) |
85 | | -checkexist php5-imagick |
86 | | -x=$(( $?|$x )) |
87 | | -echo " --- " |
88 | | -if [ $x != 0 ]; then |
89 | | - echo "One or more issues were discovered. It is unlikely that the installer will work" |
90 | | -else |
91 | | - echo "It may be possible to install the wikiation installer" |
92 | | -fi |
93 | | - |
94 | | -echo |
95 | | -echo "=== Specific things for wikiation environment" |
96 | | -test -d /var/www/revisions && echo "revisionsdir exists" || { echo "you may want to create a directory /var/www/revisions. Don't forget to modify your apache configuration."; exit 1; } |
97 | | - |
98 | | -checkexist wget || exit 1 |
99 | | - |
100 | | -touch /var/www/revisions/installertest |
101 | | -wget 'http://localhost/revisions/installertest' 2>&1 | grep "200 OK" >/dev/null && echo "apache configured well enough." || echo "apache not correctly configured" |
102 | | -rm /var/www/revisions/installertest |