2010-06-06 Raul Mateos <raulofpandora@gmail.com>
* pandora_console_upgrade: Cleaned code. Updated year. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2862 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
2f8150feb1
commit
aa8c412299
|
@ -1,6 +1,7 @@
|
|||
2010-06-06 Raúl Mateos <raulofpandora@gmail.com>
|
||||
|
||||
* pandora_console_install: Cleaned code. Updated year.
|
||||
* pandora_console_install, pandora_console_upgrade: Cleaned code.
|
||||
Updated year.
|
||||
|
||||
2010-06-06 Raúl Mateos <raulofpandora@gmail.com>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Pandora FMS 2.0 Console Upgrade (c) 2009 Artica ST
|
||||
# Pandora FMS 3.1 Console Upgrade (c) 2009-2010 Artica ST
|
||||
# Please see http://www.pandorafms.com
|
||||
# This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
@ -25,8 +25,8 @@ pandora_upgrade () {
|
|||
echo "Installing new console code in $PANDORAPATH"
|
||||
cp -R * $PANDORAPATH
|
||||
|
||||
# This makes the old-style config.php file usable with 3.0
|
||||
|
||||
# This makes the old-style config.php file usable with 3.x
|
||||
|
||||
line=$(grep "?>" -n $PANDORAPATH/include/config.php | head -1 | cut -f1 -d:)
|
||||
line=$(($line - 1))
|
||||
head -$line $PANDORAPATH/include/config.php > /tmp/asdf
|
||||
|
@ -49,7 +49,7 @@ pandora_upgrade () {
|
|||
WWWUSER=`ls -la $PANDORAPATH/index.php | awk '{ print $3 }'`
|
||||
echo "Setting permissions for $WWWUSER in $PANDORAPATH"
|
||||
chown -R $WWWUSER $PANDORAPATH
|
||||
if [ "$?" -ne 0 ]
|
||||
if [ "$?" -ne 0 ]
|
||||
then
|
||||
echo "ERROR (Cannot change $PANDORAPATH to $WWWUSER ownership)!"
|
||||
return 1
|
||||
|
@ -64,7 +64,7 @@ pandora_upgrade () {
|
|||
return 1
|
||||
fi
|
||||
|
||||
# Remove installer file
|
||||
# Remove installer file
|
||||
|
||||
[ -f $PANDORAPATH/install.php ] && rm -f $PANDORAPATH/install.php
|
||||
|
||||
|
@ -77,7 +77,7 @@ pandora_upgrade () {
|
|||
return 1
|
||||
fi
|
||||
|
||||
# Remove unnecessary files (optional, set variable to activate)
|
||||
# Remove unnecessary files (optional, set variable to activate)
|
||||
|
||||
REMOVEFILES=0
|
||||
if [ "${REMOVEFILES}" -eq 1 ]
|
||||
|
@ -98,10 +98,10 @@ pandora_upgrade () {
|
|||
}
|
||||
|
||||
help () {
|
||||
echo " -p <path> Upgrade Pandora FMS Console in path (pe: /var/www/pandora_console)"
|
||||
echo " -d Upgrade also Database (by default not upgrade Database) "
|
||||
echo " "
|
||||
exit 0
|
||||
echo " -p <path> Upgrade Pandora FMS Console in path (pe: /var/www/pandora_console)"
|
||||
echo " -d Upgrade also Database (by default not upgrade Database) "
|
||||
echo " "
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Script banner at start
|
||||
|
@ -121,26 +121,26 @@ fi
|
|||
# Main parsing code
|
||||
|
||||
while getopts ":hdp:" optname
|
||||
do
|
||||
case "$optname" in
|
||||
"h")
|
||||
help
|
||||
;;
|
||||
"d")
|
||||
UPGRADEDB=1
|
||||
;;
|
||||
"p")
|
||||
PANDORAPATH=$OPTARG
|
||||
UPGRADE=1
|
||||
;;
|
||||
?)
|
||||
help
|
||||
;;
|
||||
default)
|
||||
help
|
||||
;;
|
||||
esac
|
||||
done
|
||||
do
|
||||
case "$optname" in
|
||||
"h")
|
||||
help
|
||||
;;
|
||||
"d")
|
||||
UPGRADEDB=1
|
||||
;;
|
||||
"p")
|
||||
PANDORAPATH=$OPTARG
|
||||
UPGRADE=1
|
||||
;;
|
||||
?)
|
||||
help
|
||||
;;
|
||||
default)
|
||||
help
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$UPGRADE" == "1" ]
|
||||
then
|
||||
|
|
Loading…
Reference in New Issue