"Fossies" - the Fresh Open Source Software Archive

Member "pandora_server/pandora_server_upgrade" (5 Nov 2021, 2326 Bytes) of package /linux/misc/pandorafms_server-7.0NG.758.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 
    3 # Pandora FMS Server Upgrader (c) 2008-2010 Artica ST
    4 # Linux Version (generic), for SuSe and Debian/Ubuntu only
    5 # other Linux distros could not work properly without modifications
    6 # Please see http://www.pandorafms.org
    7 # v3.2 Build 101122
    8 # This code is licensed under GPL 2.0 license.
    9 # **********************************************************************
   10 
   11 MODE=$1
   12 
   13 install () {
   14 
   15     echo "Installing new libraries and server executables...."
   16     perl Makefile.PL
   17     make
   18     make install
   19 
   20     echo "Setting permissions..."
   21 
   22     chmod 750 bin/*
   23     chmod 750 pandora_* 
   24     chmod 750 util/*.pl
   25     chmod 750 util/*.sh
   26     chmod 750 util/tentacle_serverd
   27     chmod 750 util/pandora_server
   28     chmod 750 util/plugin/*
   29 
   30     echo "Copying utilities...."
   31     cp -R util /usr/share/pandora_server
   32     
   33     echo "Rebuilding links /usr/local/bin -> /usr/bin"
   34     #rm /usr/local/bin/pandora_server 2> /dev/null
   35     #rm /usr/local/bin/pandora_exec 2> /dev/null
   36     ln -s /usr/local/bin/pandora_server /usr/bin/pandora_server 2> /dev/null
   37     ln -s /usr/local/bin/pandora_exec /usr/bin/pandora_exec 2> /dev/null
   38 
   39     if [ -d /etc/logrotate.d ]; then
   40         echo "Creating logrotate.d entry for Pandora FMS log management"
   41         cp util/pandora_server_logrotate /etc/logrotate.d/pandora_server
   42     else
   43         echo "Please add a log rotation schedule manually to your log rotation daemon (if any)"
   44     fi
   45 
   46     echo "Copying startup scripts to /etc/init.d...."
   47     cp util/pandora_server /etc/init.d
   48     cp util/tentacle_serverd /etc/init.d
   49 
   50     if [ ! -e /etc/cron.hourly/pandora_db ]
   51     then
   52         echo "You don't have a /etc/cron.hourly/pandora_db file, you should consider"
   53         echo "to setup the Pandora FMS Database Maintance script. Create with 755 perms a file in /etc/cron.hourly "
   54         echo "called 'pandora_db', with following contents: "
   55         echo " "
   56         echo "  perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf"
   57     fi
   58 
   59     echo " "
   60     echo "DONE!. Don't forget to restart all your Pandora FMS servers running in this machine"
   61     echo " "
   62 }
   63 
   64 help () {
   65     echo "  --upgrade   To upgrade Pandora FMS Servers on this system (You have to be root)"
   66     echo " "
   67 }
   68 
   69 # Script banner at start
   70 echo " "
   71 echo "Pandora FMS 6.0 Server Upgrade (c) 2009-2015 Artica ST"
   72 echo "This program is licensed under GPL2 Terms. http://pandorafms.org"
   73 echo " "
   74 
   75 case "$MODE" in
   76 
   77 '--upgrade')
   78     install
   79     exit
   80     ;;
   81 
   82 *)
   83     help
   84 esac
   85