2009-12-16 19:15:25 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2010-05-16 00:32:56 +02:00
|
|
|
# Pandora FMS Server Upgrader (c) 2008-2010 Artica ST
|
2009-12-16 19:15:25 +01:00
|
|
|
# Linux Version (generic), for SuSe and Debian/Ubuntu only
|
|
|
|
# other Linux distros could not work properly without modifications
|
|
|
|
# Please see http://www.pandorafms.org
|
2010-05-16 00:32:56 +02:00
|
|
|
# v3.1.0 Build 100516
|
2009-01-21 02:52:46 +01:00
|
|
|
# This code is licensed under GPL 2.0 license.
|
|
|
|
# **********************************************************************
|
|
|
|
|
|
|
|
MODE=$1
|
|
|
|
|
|
|
|
install () {
|
|
|
|
|
|
|
|
echo "Installing new libraries and server executables...."
|
|
|
|
perl Makefile.PL
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
|
|
|
|
echo "Setting permissions..."
|
|
|
|
|
|
|
|
chmod 750 bin/*
|
|
|
|
chmod 750 pandora_*
|
|
|
|
chmod 750 util/*.pl
|
2009-11-08 02:38:04 +01:00
|
|
|
chmod 750 util/*.sh
|
|
|
|
chmod 750 util/tentacle_serverd
|
|
|
|
chmod 750 util/pandora_server
|
2009-01-21 02:52:46 +01:00
|
|
|
chmod 750 util/plugin/*
|
|
|
|
|
|
|
|
echo "Copying utilities...."
|
2009-11-08 02:38:04 +01:00
|
|
|
cp -R util /usr/share/pandora_server
|
2009-12-18 19:22:33 +01:00
|
|
|
cp bin/pandora_exec /usr/bin
|
2009-11-10 01:33:16 +01:00
|
|
|
|
|
|
|
echo "Rebuilding links /usr/local/bin -> /usr/bin"
|
2009-12-18 19:22:33 +01:00
|
|
|
rm /usr/local/bin/pandora_server 2> /dev/null
|
|
|
|
rm /usr/local/bin/pandora_exec 2> /dev/null
|
2009-11-10 01:33:16 +01:00
|
|
|
|
|
|
|
if [ -d /etc/logrotate.d ]; then
|
|
|
|
echo "Creating logrotate.d entry for Pandora FMS log management"
|
|
|
|
cp util/pandora_logrotate /etc/logrotate.d/pandora
|
|
|
|
else
|
|
|
|
echo "Please add a log rotation schedule manually to your log rotation daemon (if any)"
|
|
|
|
fi
|
2009-01-21 02:52:46 +01:00
|
|
|
|
|
|
|
echo "Copying startup scripts to /etc/init.d...."
|
2009-11-10 01:33:16 +01:00
|
|
|
cp util/pandora_server /etc/init.d
|
2009-11-08 02:38:04 +01:00
|
|
|
cp util/tentacle_serverd /etc/init.d
|
2009-01-21 02:52:46 +01:00
|
|
|
|
2009-12-16 19:15:25 +01:00
|
|
|
if [ ! -e /etc/cron.daily/pandora_purge_db ]
|
2009-01-21 02:52:46 +01:00
|
|
|
then
|
|
|
|
echo "You don't have a /etc/cron.daily/pandora_purge_db file, you should consider"
|
|
|
|
echo "to setup the Pandora FMS daily Database Maintance script: "
|
2009-12-16 19:15:25 +01:00
|
|
|
echo " perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf"
|
2009-01-21 02:52:46 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo " "
|
2009-11-08 02:38:04 +01:00
|
|
|
echo "DONE!. Don't forget to restart all your Pandora FMS servers running in this machine"
|
2009-01-21 02:52:46 +01:00
|
|
|
echo " "
|
|
|
|
}
|
|
|
|
|
|
|
|
help () {
|
2009-12-16 19:15:25 +01:00
|
|
|
echo " --upgrade To upgrade Pandora FMS Servers on this system (You have to be root)"
|
|
|
|
echo " "
|
2009-01-21 02:52:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Script banner at start
|
|
|
|
echo " "
|
2010-05-16 00:32:56 +02:00
|
|
|
echo "Pandora FMS 3.1 Server Upgrade (c) 2009-2010 Artica ST"
|
2009-12-16 19:15:25 +01:00
|
|
|
echo "This program is licensed under GPL2 Terms. http://pandorafms.org"
|
2009-01-21 02:52:46 +01:00
|
|
|
echo " "
|
|
|
|
|
|
|
|
case "$MODE" in
|
|
|
|
|
|
|
|
'--upgrade')
|
2009-12-16 19:15:25 +01:00
|
|
|
install
|
|
|
|
exit
|
|
|
|
;;
|
2009-01-21 02:52:46 +01:00
|
|
|
|
|
|
|
*)
|
2009-12-16 19:15:25 +01:00
|
|
|
help
|
2009-01-21 02:52:46 +01:00
|
|
|
esac
|
|
|
|
|