diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 1e9c74d341..74522da055 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,6 +1,7 @@ 2010-06-06 Raúl Mateos - * pandora_console_install: Cleaned code. Updated year. + * pandora_console_install, pandora_console_upgrade: Cleaned code. + Updated year. 2010-06-06 Raúl Mateos diff --git a/pandora_console/pandora_console_upgrade b/pandora_console/pandora_console_upgrade index 5b01d547f5..1dc3a15a30 100644 --- a/pandora_console/pandora_console_upgrade +++ b/pandora_console/pandora_console_upgrade @@ -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 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 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