root/tags/oreon-1.3.2-b2/install.sh

Revision 1060, 19.7 kB (checked in by wistof, 2 years ago)

- manage nagios_init_script

Line 
1#!/bin/sh
2#
3# Oreon is developped with Apache Licence 2.0 :
4# http://www.apache.org/licenses/LICENSE-2.0.txt
5# Developped by : Julien Mathis - Romain Le Merlus
6#                 Christophe Coraboeuf - Mathieu Chateau
7
8# The Software is provided to you AS IS and WITH ALL FAULTS.
9# OREON makes no representation and gives no warranty whatsoever,
10# whether express or implied, and without limitation, with regard to the quality,
11# safety, contents, performance, merchantability, non-infringement or suitability for
12# any particular or intended purpose of the Software found on the OREON web site.
13# In no event will OREON be liable for any direct, indirect, punitive, special,
14# incidental or consequential damages however they may arise and even if OREON has
15# been previously advised of the possibility of such damages.
16
17cat <<EOF
18###############################################################################
19#                    OREON Project (www.oreon-project.org)                    #
20#                            Thanks for using OREON                           #
21#                                                                             #
22#                                    v 1.3                                    #
23#                                                                             #
24#                             infos@oreon-project.org                         #
25#                                                                             #
26#                     Make sure you have installed and configured             #
27#                                   sudo - sed                                #
28#                          php - apache - rrdtool - mysql                     #
29#                                                                             #
30#                                                                             #
31###############################################################################
32#                                 The Team OREON                              #
33###############################################################################
34EOF
35
36#Load install script functions
37if [ -z "$BASH" ]; then # Test if BASH is in path
38    if ! which bash > /dev/null 2>&1; then
39        echo "Install bash and try `bash install.sh`."
40    fi # Exit if we are not in BASH
41    echo "Error: The script must be run with BASH shell. Try:"
42    echo "# bash install.sh"
43    exit 1
44fi
45. functions
46
47##
48## VARIABLES
49##
50## Make sure you know what you do if you modify it !!
51
52SRC_OREON="oreon_src"
53
54PLUGINS_DIR="Plugins/"
55
56PWD=`pwd`
57
58LOG_FILE="$PWD/log/install_oreon.log"
59
60date > $LOG_FILE
61
62TRUETYPE="/usr/X11R6/lib/X11/fonts/truetype"
63
64
65echo ""
66$SETCOLOR_WARNING
67echo "                     Make sure you have root permissions !"
68echo ""
69echo ""
70echo " WARNING : Setup will delete all previous informations in your OREON DATABASE. "
71$SETCOLOR_NORMAL
72echo ""
73echo "Are you sure to continue ?"
74echo -n "[y/n], default to [n]:"
75read temp
76if [ -z $temp ];then
77    temp=n
78fi
79
80if [ $temp = "n" ];then
81    echo "Okay... have a nice day!"
82    exit
83fi
84
85test_answer()
86{
87    #$1 variable to fill
88    #$2 text typed by user
89    if [ ! -z $2 ];then
90        if [ $2 != "" ];then
91      eval $1=$2
92        fi
93    fi
94}
95
96##
97## CONFIGURATION
98##
99if test -a $OREON_CONF ; then
100        echo ""
101        echo_success "Finding Oreon configuration file '$OREON_CONF' :" "OK"
102        echo "You already seem to have to install Oreon."
103    echo "Do you want use last Oreon install parameters ?"
104        echo -n "[y/n], default to [y]:"
105        read temp
106        if [ -z $temp ];then
107            temp=y
108        fi
109
110        if [ $temp = "y" ];then
111            echo ""
112                echo_passed "Using '$OREON_CONF' :" "PASSED"
113            . $OREON_CONF
114            echo ""
115        else
116                echo ""
117                echo "First, let's talk about you !"
118                echo "-----------------------------"
119                echo ""
120        fi
121fi
122
123        if [ -z $INSTALL_DIR_NAGIOS ];then
124                INSTALL_DIR_NAGIOS="/usr/local/nagios"
125                echo "Where is installed Nagios ?"
126                echo -n "default to [$INSTALL_DIR_NAGIOS]:"
127                read temp
128                test_answer INSTALL_DIR_NAGIOS $temp
129                INSTALL_DIR_NAGIOS=${INSTALL_DIR_NAGIOS%/}
130                echo ""
131        fi
132
133        if [ -z $NAGIOS_ETC ];then
134                #nagios etc directory for oreon
135                NAGIOS_ETC="$INSTALL_DIR_NAGIOS/etc"
136                echo "Where are your nagios etc directory ?"
137                echo -n "default to [$NAGIOS_ETC]:"
138                read temp
139                test_answer NAGIOS_ETC $temp
140                NAGIOS_ETC=${NAGIOS_ETC%/}
141                if [ -a "${NAGIOS_ETC}/nagios.cfg" ]; then
142                     echo_success "Path $NAGIOS_ETC/nagios.cfg" "OK"
143                else
144                        echo_passed "${NAGIOS_ETC}/nagios.cfg not found" "CRITICAL"
145                        echo "Where are your nagios etc directory ?"
146                        echo -n " :"
147                        read temp
148                        test_answer NAGIOS_ETC $temp
149                        NAGIOS_ETC=${NAGIOS_ETC%/}
150                fi
151                echo ""
152        fi
153
154        if [ -z $NAGIOS_PLUGIN ];then
155                #nagios plugins directory for oreon
156                NAGIOS_PLUGIN="$INSTALL_DIR_NAGIOS/libexec"
157                echo "Where are your nagios plugins / libexec  directory ?"
158                echo -n "default to [$NAGIOS_PLUGIN]:"
159                read temp
160                test_answer NAGIOS_PLUGIN $temp
161                NAGIOS_PLUGIN=${NAGIOS_PLUGIN%/}
162                echo ""
163        fi
164
165        if [ -z $NAGIOS_BIN ];then
166                #nagios plugins directory for oreon
167                NAGIOS_BIN="$INSTALL_DIR_NAGIOS/bin"
168                echo "Where are your nagios bin  directory ?"
169                echo -n "default to [$NAGIOS_BIN]:"
170                read temp
171                test_answer NAGIOS_BIN $temp
172                NAGIOS_BIN=${NAGIOS_BIN%/}
173                echo ""
174        fi
175
176        if [ -z $INSTALL_DIR_OREON ];then
177                #setup directory for oreon
178                INSTALL_DIR_OREON="/usr/local/oreon"
179                echo "Where do I install Oreon ?"
180                echo -n "default to [$INSTALL_DIR_OREON]:"
181                read temp
182                test_answer INSTALL_DIR_OREON $temp
183                INSTALL_DIR_OREON=${INSTALL_DIR_OREON%/}
184                echo ""
185        fi
186
187        if [ -z $SUDO_FILE ];then
188                #Configuration file for sudo
189                SUDO_FILE="/etc/sudoers"
190                echo "Where is sudo ?"
191                echo -n "default to [$SUDO_FILE]:"
192                read temp
193                test_answer SUDO_FILE $temp
194                SUDO_FILE=${SUDO_FILE%/}
195                echo ""
196        fi
197
198        if [ -z $RRD_PERL ];then
199                #RRDTOOL perl module directory
200                RRD_PERL="/usr/local/rrdtool/lib/perl"
201                echo "Where is installed RRD perl modules (RRDs.pm) ?"
202                echo "Just put directory, not full path."
203                echo -n "default to [$RRD_PERL]:"
204                read temp
205                test_answer RRD_PERL $temp
206                RRD_PERL=${RRD_PERL%/}
207                echo ""
208        fi
209
210        if [ -z $BIN_RRDTOOL ];then
211                #RRDTOOL binary path
212                BIN_RRDTOOL="/usr/bin/rrdtool"
213                echo "Where is rrdtool binary ?"
214                echo -n "default to [$BIN_RRDTOOL]:"
215                read temp
216                test_answer BIN_RRDTOOL $temp
217                BIN_RRDTOOL=${BIN_RRDTOOL%/}
218                if [ -x "$BIN_RRDTOOL" ]; then
219                     echo_success "$BIN_RRDTOOL" "OK"
220                else
221                        echo_passed "$BIN_RRDTOOL not found" "CRITICAL"
222                        echo "Where is rrdtool binary ?"
223                        echo -n " :"
224                        read temp
225                        test_answer BIN_RRDTOOL $temp
226                        BIN_RRDTOOL=${BIN_RRDTOOL%/}
227                fi
228                echo ""
229        fi
230
231
232        if [ -z $BIN_MAIL ];then
233                #MAIL binary path
234                BIN_MAIL="/usr/bin/mail"
235                echo "Where is mail binary ?"
236                echo -n "default to [$BIN_MAIL]:"
237                read temp
238                test_answer BIN_MAIL $temp
239                BIN_MAIL=${BIN_MAIL%/}
240                if [ -x "$BIN_MAIL" ]; then
241                     echo_success "$BIN_MAIL" "OK"
242                else
243                        echo_passed "$BIN_MAIL not found" "CRITICAL"
244                        echo "Where is mail binary ?"
245                        echo -n " :"
246                        read temp
247                        test_answer BIN_MAIL $temp
248                        BIN_MAIL=${BIN_MAIL%/}
249                fi
250
251                echo ""
252        fi
253
254        if [ -z $PEAR_PATH ];then
255                PEAR_PATH="/usr/share/pear"
256                echo "Where is PEAR Path ?"
257                echo -n "default to [$PEAR_PATH]:"
258                read temp
259                test_answer PEAR_PATH $temp
260                PEAR_PATH=${PEAR_PATH%/}
261                if [ -a "${PEAR_PATH}/PEAR.php" ]; then
262                     echo_success "PEAR Path $PEAR_PATH/PEAR.php" "OK"
263                else
264                        echo_passed "${PEAR_PATH}/PEAR.php not found" "CRITICAL"
265                        echo "Where is PEAR Path ?"
266                        echo -n "default to [$PEAR_PATH]:"
267                        read temp
268                        test_answer PEAR_PATH $temp
269                        PEAR_PATH=${PEAR_PATH%/}
270                fi
271                echo ""
272        fi
273
274
275##
276## Functions
277##
278
279# When exit on error
280
281function error()
282{
283    echo "ERROR"
284    exit 2
285}
286
287# Check apache version, and configure it. Ask to restart apache server
288# Make a copy of the original file as httpd.conf.initial
289
290function configure_apache()
291{
292    echo ""
293    echo "Configure Apache server"
294    echo "-----------------------"
295
296  if test -d $INSTALL_DIR_OREON ; then
297      echo_passed "$INSTALL_DIR_OREON already exists" "PASSED"
298  else
299      mkdir $INSTALL_DIR_OREON 2>&1 >> ${LOG_FILE}
300      echo_success "Creating $INSTALL_DIR_OREON" "OK"
301  fi
302
303    # configure httpd.conf
304    if test -e $DIR_APACHE_CONF/oreon.conf ; then
305                echo "Finding Apache Oreon configuration file"
306                echo_success "'$DIR_APACHE_CONF/oreon.conf' :" "OK"
307            echo "Do you want rewrite Apache configuration file ?"
308                echo -n "[y/n], default to [y]:"
309                read temp
310                if [ -z $temp ];then
311                    temp=y
312                fi
313        else
314            temp=y
315        fi
316
317        if [ $temp = "y" ];then
318             echo "" > $DIR_APACHE_CONF/oreon.conf
319             cat << EOF >> $DIR_APACHE_CONF/oreon.conf
320##
321## Section add by OREON Install Setup
322##
323
324AddType application/x-java-jnlp-file .jnlp
325Alias /oreon/ $INSTALL_DIR_OREON/www/
326<Directory "$INSTALL_DIR_OREON/www">
327    Options None
328    AllowOverride AuthConfig Options
329    Order allow,deny
330    Allow from all
331</Directory>
332
333EOF
334            echo_success "Create '$DIR_APACHE_CONF/oreon.conf'" "OK"
335            echo_success "Configuring Apache" "OK"
336    else
337            echo_passed "Apache is already configurated" "PASSED"
338    fi
339
340    # add apache user to nagios group
341    usermod -G $NAGIOS_GROUP,$WEB_USER $WEB_USER >> $LOG_FILE 2>> $LOG_FILE
342    echo_success "User $WEB_USER added to nagios group" "OK"
343    echo ""
344
345    #restart apache !
346    if test -x /etc/init.d/apache ; then
347    /etc/init.d/apache restart >> $LOG_FILE 2>> $LOG_FILE
348    else if test -x /etc/init.d/httpd ; then
349    /etc/init.d/httpd restart
350  else if test -e /etc/init.d/apache2 ; then
351    /etc/init.d/apache2 restart >> $LOG_FILE 2>> $LOG_FILE
352    else
353      echo_warning "Unable to restart apache server" "WARNING"
354    fi
355    fi
356    fi
357
358}
359
360# install OREON interface
361
362function confirm_oreon()
363{
364    if test -f $INSTALL_DIR_OREON/www/oreon.conf.php ; then
365          echo ""
366          echo "Oreon is already install on your server !"
367
368          echo -n "Are you sure you want to install OREON ?"
369      echo -n "[y/n], default to [n]:"
370          read answer
371          if [ -z $answer ];then
372                answer=n
373          fi
374          if [ $answer == 'n' ]; then
375              echo "Ok, so bye bye !! "
376              exit
377          else if [ $answer == 'y' ]; then
378              install_oreon
379              config_sudo
380              #restart_mysql
381          else
382              echo "Please answer y or n ! "
383              confirm_oreon
384          fi
385          fi
386    else
387            install_oreon
388            config_sudo
389            #restart_mysql
390    fi
391}
392
393## old install_oreon
394
395
396function restart_mysql()
397{
398  # restart mysql to be sure that mysqld is running !
399    echo ""
400    echo "Restart Mysql server"
401    echo "-------------------"
402  if test -x /etc/init.d/mysqld ; then
403      /etc/init.d/mysqld restart
404  else if test -x /etc/init.d/mysql ; then
405      /etc/init.d/mysql restart
406  else
407      echo_failure "We don't find Mysql server. OREON will not run." "FAILURE"
408      exit
409  fi
410  fi
411}
412
413function config_sudo()
414{
415# modify sudoers file
416    echo ""
417    echo "Configure Sudo"
418    echo "--------------"
419
420        # Find Nagios Init Script
421        check_nagios_init_script
422
423  sudo=`cat $SUDO_FILE | grep OREON > /dev/null; echo $?`
424
425  if [ $sudo == '1' ]; then
426      echo "#Add by OREON installation script" >> $SUDO_FILE
427      echo "User_Alias      OREON= $WEB_USER" >> $SUDO_FILE
428      echo "## Nagios Restart" >> $SUDO_FILE
429      echo "OREON   ALL = NOPASSWD: $NAGIOS_INIT_SCRIPT restart" >> $SUDO_FILE
430      echo "## Nagios reload" >> $SUDO_FILE
431      echo "OREON   ALL = NOPASSWD: $NAGIOS_INIT_SCRIPT reload" >> $SUDO_FILE
432      echo "## Snmptrapd Restart" >> $SUDO_FILE
433      echo "OREON   ALL = NOPASSWD: /etc/init.d/snmptrapd restart" >> $SUDO_FILE
434      echo "" >> $SUDO_FILE
435      echo_success "Configuring Sudo" "OK"
436  else
437      echo_passed "Sudo is already configurated" "PASSED"
438  fi
439}
440
441function oreon_post_install()
442{
443    echo ""
444    echo "Post Install"
445    echo "------------"
446
447      #BIN_MAIL=`whereis -b mail | cut -d : -f2`
448      #BIN_MAIL=${BIN_MAIL# }
449          echo_success "Finding mail binary : $BIN_MAIL " "OK"
450
451          #BIN_RRDTOOL=`whereis -b rrdtool | cut -d : -f2 | cut -d " " -f2`
452      #BIN_RRDTOOL=${BIN_RRDTOOL# }
453          echo_success "Finding rrdtool binary : $BIN_RRDTOOL " "OK"
454
455
456          INSTALL_DIR_OREON_CONF="$INSTALL_DIR_OREON/www/install/installoreon.conf.php"
457      echo "<?" > $INSTALL_DIR_OREON_CONF
458      echo "/**" >> $INSTALL_DIR_OREON_CONF
459      echo "Oreon is developped with GPL Licence 2.0 :" >> $INSTALL_DIR_OREON_CONF
460      echo "http://www.gnu.org/licenses/gpl.txt" >> $INSTALL_DIR_OREON_CONF
461      echo "Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf" >> $INSTALL_DIR_OREON_CONF
462      echo "" >> $INSTALL_DIR_OREON_CONF
463      echo "The Software is provided to you AS IS and WITH ALL FAULTS." >> $INSTALL_DIR_OREON_CONF
464      echo "OREON makes no representation and gives no warranty whatsoever," >> $INSTALL_DIR_OREON_CONF
465      echo "whether express or implied, and without limitation, with regard to the quality," >> $INSTALL_DIR_OREON_CONF
466      echo "safety, contents, performance, merchantability, non-infringement or suitability for" >> $INSTALL_DIR_OREON_CONF
467      echo "any particular or intended purpose of the Software found on the OREON web site." >> $INSTALL_DIR_OREON_CONF
468      echo "In no event will OREON be liable for any direct, indirect, punitive, special," >> $INSTALL_DIR_OREON_CONF
469      echo "incidental or consequential damages however they may arise and even if OREON has" >> $INSTALL_DIR_OREON_CONF
470      echo "been previously advised of the possibility of such damages." >> $INSTALL_DIR_OREON_CONF
471      echo "" >> $INSTALL_DIR_OREON_CONF
472      echo "For information : contact@oreon-project.org" >> $INSTALL_DIR_OREON_CONF
473      echo "    */" >> $INSTALL_DIR_OREON_CONF
474      echo "" >> $INSTALL_DIR_OREON_CONF
475      echo "\$conf_installoreon['oreon_dir'] = \"$INSTALL_DIR_OREON/\";" >> $INSTALL_DIR_OREON_CONF
476      echo "\$conf_installoreon['oreon_dir_www'] = \"$INSTALL_DIR_OREON/www/\";" >> $INSTALL_DIR_OREON_CONF
477      echo "\$conf_installoreon['oreon_dir_rrd'] = \"$INSTALL_DIR_OREON/rrd/\";" >> $INSTALL_DIR_OREON_CONF
478      echo "\$conf_installoreon['nagios'] = \"$INSTALL_DIR_NAGIOS/\";" >> $INSTALL_DIR_OREON_CONF
479      echo "\$conf_installoreon['nagios_conf'] = \"$NAGIOS_ETC/\";" >> $INSTALL_DIR_OREON_CONF
480      echo "\$conf_installoreon['nagios_plugins'] = \"$NAGIOS_PLUGIN/\";" >> $INSTALL_DIR_OREON_CONF
481      echo "\$conf_installoreon['nagios_bin'] = \"$NAGIOS_BIN/\";" >> $INSTALL_DIR_OREON_CONF
482      echo "\$conf_installoreon['nagios_init_script'] = \"$NAGIOS_INIT_SCRIPT\";" >> $INSTALL_DIR_OREON_CONF
483      echo "\$conf_installoreon['rrdtool_dir'] = \"$BIN_RRDTOOL\";" >> $INSTALL_DIR_OREON_CONF
484      echo "\$conf_installoreon['apache_user'] = \"$WEB_USER\";" >> $INSTALL_DIR_OREON_CONF
485      echo "\$conf_installoreon['apache_group'] = \"$WEB_GROUP\";" >> $INSTALL_DIR_OREON_CONF
486      echo "\$conf_installoreon['nagios_user'] = \"$NAGIOS_USER\";" >> $INSTALL_DIR_OREON_CONF
487      echo "\$conf_installoreon['nagios_group'] = \"$NAGIOS_GROUP\";" >> $INSTALL_DIR_OREON_CONF
488      echo "\$conf_installoreon['mail'] = \"$BIN_MAIL\";" >> $INSTALL_DIR_OREON_CONF
489      #echo "\$conf_installoreon['rrdtool_dir'] = \"$BIN_RRDTOOL\";" >> $INSTALL_DIR_OREON_CONF
490      echo "\$conf_installoreon['pear_dir'] = \"$PEAR_PATH\";" >> $INSTALL_DIR_OREON_CONF
491
492      for fichier in `cat $NAGIOS_ETC/nagios.cfg | grep _file | grep -v \#`
493      do
494        echo -n "\$conf_installoreon['" >> $INSTALL_DIR_OREON_CONF
495            tmp=`echo  "$fichier" | cut -d = -f1` >> $INSTALL_DIR_OREON_CONF
496        echo -n $tmp >> $INSTALL_DIR_OREON_CONF
497        echo -n "'] = \"" >> $INSTALL_DIR_OREON_CONF
498        tmp=`echo "$fichier" | cut -d = -f2` >> $INSTALL_DIR_OREON_CONF
499        echo -n $tmp >> $INSTALL_DIR_OREON_CONF
500        echo "\";" >> $INSTALL_DIR_OREON_CONF
501      done
502      for fichier in `cat $NAGIOS_ETC/nagios.cfg | grep _path | grep -v \#`
503      do
504        echo -n "\$conf_installoreon['" >> $INSTALL_DIR_OREON_CONF
505            tmp=`echo  "$fichier" | cut -d = -f1` >> $INSTALL_DIR_OREON_CONF
506        echo -n $tmp >> $INSTALL_DIR_OREON_CONF
507        echo -n "'] = \"" >> $INSTALL_DIR_OREON_CONF
508        tmp=`echo "$fichier" | cut -d = -f2` >> $INSTALL_DIR_OREON_CONF
509        echo -n $tmp >> $INSTALL_DIR_OREON_CONF
510        echo "\";" >> $INSTALL_DIR_OREON_CONF
511      done
512        for fichier in `cat $NAGIOS_ETC/cgi.cfg | grep physical_html_path | grep -v \#`
513      do
514        echo -n "\$conf_installoreon['" >> $INSTALL_DIR_OREON_CONF
515            tmp=`echo  "$fichier" | cut -d = -f1` >> $INSTALL_DIR_OREON_CONF
516        echo -n $tmp >> $INSTALL_DIR_OREON_CONF
517        echo -n "'] = \"" >> $INSTALL_DIR_OREON_CONF
518        tmp=`echo "$fichier" | cut -d = -f2` >> $INSTALL_DIR_OREON_CONF
519        echo -n $tmp >> $INSTALL_DIR_OREON_CONF
520        echo "\";" >> $INSTALL_DIR_OREON_CONF
521      done
522
523      echo "?>" >> $INSTALL_DIR_OREON_CONF
524      echo_success "Create $INSTALL_DIR_OREON_CONF" "OK"
525
526     echo "INSTALL_DIR_OREON=$INSTALL_DIR_OREON" > $OREON_CONF
527     echo "NAGIOS_ETC=$NAGIOS_ETC" >> $OREON_CONF
528     echo "NAGIOS_PLUGIN=$NAGIOS_PLUGIN" >> $OREON_CONF
529     echo "NAGIOS_BIN=$NAGIOS_BIN" >> $OREON_CONF
530     echo "INSTALL_DIR_NAGIOS=$INSTALL_DIR_NAGIOS" >> $OREON_CONF
531     echo "RRD_PERL=$RRD_PERL" >> $OREON_CONF
532     echo "SUDO_FILE=$SUDO_FILE" >> $OREON_CONF
533     echo "WEB_USER=$WEB_USER" >> $OREON_CONF
534     echo "WEB_GROUP=$WEB_GROUP" >> $OREON_CONF
535     echo "NAGIOS_USER=$NAGIOS_USER" >> $OREON_CONF
536     echo "NAGIOS_GROUP=$NAGIOS_GROUP" >> $OREON_CONF
537     echo "BIN_RRDTOOL=$BIN_RRDTOOL" >> $OREON_CONF
538     echo "BIN_MAIL=$BIN_MAIL" >> $OREON_CONF
539     echo "PEAR_PATH=$PEAR_PATH" >> $OREON_CONF
540
541
542     echo_success "Create $OREON_CONF " "OK"
543     echo_success "Configuring Oreon post-install" "OK"
544}
545
546
547##
548## INSTALL
549##
550echo "Users Management"
551echo "----------------"
552# check for httpd directory
553check_httpd_directory
554## group apache
555check_group_apache
556## user apache
557check_user_apache
558check_group_nagios
559check_user_nagios
560echo ""
561
562echo "Other Stuff"
563echo "------------"
564if test -d $NAGIOS_PLUGIN ; then
565    echo_success "Nagios libexec directory" "OK"
566else
567    mkdir -p $NAGIOS_PLUGIN > /dev/null
568    echo_success "Nagios libexec directory created" "OK"
569fi
570
571if test -d $TRUETYPE ; then
572    cp truetype/verdanab.ttf $TRUETYPE/verdanab.ttf > /dev/null
573    echo_success "TrueType verdana installed" "OK"
574else
575    mkdir -p $TRUETYPE > /dev/null
576    echo_success "TrueType directory created" "OK"
577    cp truetype/verdanab.ttf $TRUETYPE/verdanab.ttf > /dev/null
578    echo_success "TrueType verdana installed" "OK"
579fi
580
581  #PEAR_PATH=`whereis -b pear | cut -d : -f2 | cut -d " " -f4`
582 # PEAR_PATH=${PEAR_PATH# }
583 # PEAR_PATH=${PEAR_PATH%/}
584  echo_success "Finding PEAR Path : $PEAR_PATH " "OK"
585        if test -d "$PEAR_PATH/Image/Canvas/Fonts" ; then
586                cp truetype/arial.ttf $PEAR_PATH/Image/Canvas/Fonts/arial.ttf > /dev/null
587                cp truetype/fontmap.txt $PEAR_PATH/Image/Canvas/Fonts/fontmap.txt > /dev/null
588                echo_success "PEAR Font installed" "OK"
589        else
590                if [ -z $PEAR_PATH ];then
591                        echo_passed "PEAR directory not found" "PASSED"
592                else
593                    mkdir -p "$PEAR_PATH/Image/Canvas/Fonts" > /dev/null
594                    echo_success "PEAR Font directory created" "OK"
595                    cp truetype/arial.ttf $PEAR_PATH/Image/Canvas/Fonts/arial.ttf > /dev/null
596                        cp truetype/fontmap.txt $PEAR_PATH/Image/Canvas/Fonts/fontmap.txt > /dev/null
597                    echo_success "PEAR Font installed" "OK"
598                 fi
599        fi
600
601
602
603# installation script
604
605#check_group_nagiocmd
606configure_apache
607confirm_oreon
608oreon_post_install
609
610echo ""
611cat <<EOF
612###############################################################################
613#      Go to the URL : http://your-server/oreon/  to finish the setup         #
614#                                                                             #
615#                    Report bugs at bugs@oreon-project.org                    #
616#                                                                             #
617#                             Thanks for using OREON.                         #
618#                             -----------------------                         #
619#                        Contact : infos@oreon-project.org                    #
620#                           http://www.oreon-project.org                      #
621###############################################################################
622EOF
Note: See TracBrowser for help on using the browser.