#! /bin/bash
#######################################
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
#######################################
#Copyright SISalp www.sisalp.fr
#par dominique.chabord@sisalp.org SISalp.org
#
#
MY_VERSION="version 29 jul 2009-0"
REVISION="rev. 29 jul 2009-0"
OLD_STRING="openerp-web-5.0.0-3.1"
NEW_STRING="openerp-web-5.0.1-0"
if [ -f "/home/sisalpuser/openerp/xoe_mgt/server/etc/xoeservices.conf" ] ; then
	if cat /home/sisalpuser/openerp/xoe_mgt/server/etc/xoeservices.conf | grep -q "$OLD_STRING" ; then
		hostname
		xoe --etiny -stop
		cp /home/sisalpuser/openerp/xoe_mgt/server/etc/xoeservices.conf /home/sisalpuser/openerp/xoe_mgt/server/etc/xoeservices.conf.temp.save
		cat /home/sisalpuser/openerp/xoe_mgt/server/etc/xoeservices.conf.temp.save | sed s/$OLD_STRING/$NEW_STRING/ > /home/sisalpuser/openerp/xoe_mgt/server/etc/xoeservices.conf
		xoe --directory -update -etiny etinyfor5
		xoe --etiny -start
		echo "Done"
	fi
fi
exit 0
