1
# openerp-restore-addons.sh
3
# Copyright 2010 ClearCorp S.A. <info@clearcorp.co.cr>
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
if [[ ! -d $OPENERP_CCORP_DIR ]]; then
22
echo "openerp-ccorp-scripts not installed."
27
. $OPENERP_CCORP_DIR/main-lib/checkRoot.sh
28
. $OPENERP_CCORP_DIR/main-lib/getDist.sh
29
. $OPENERP_CCORP_DIR/openerp-scripts/openerp-lib.sh
35
INSTALL_LOG_PATH=/var/log/openerp
36
INSTALL_LOG_FILE=$INSTALL_LOG_PATH/install.log
38
if [[ ! -f $INSTALL_LOG_FILE ]]; then
39
mkdir -p $INSTALL_LOG_PATH
40
touch $INSTALL_LOG_FILE
44
echo "$(date): $1" >> $INSTALL_LOG_FILE
55
log_echo "Distribution: $dist"
61
log_echo "OpenERP update addons script"
62
log_echo "----------------------------"
65
# Source installation variables
66
if [ -d /etc/openerp/5.0 ] && [ ! -d /etc/openerp/6.0 ]; then
68
elif [ ! -d /etc/openerp/5.0 ] && [ -d /etc/openerp/6.0 ]; then
72
while [[ ! $branch =~ ^[56]$ ]]; do
73
read -p "You have installed versions 5 and 6, choose the version for this server instance (5/_6_): " branch
74
if [[ $branch == "" ]]; then
81
if [[ $branch =~ ^[5]$ ]]; then
82
log_echo "This server will use 5.0 branch."
85
log_echo "This server will use 6.0 branch."
89
. /etc/openerp/$branch/install.cfg
92
while [[ $name == "" ]]; do
93
read -p "Enter the OpenERP server name: " name
94
if [[ $name == "" ]]; then
95
log_echo "The name cannot be blank."
96
elif [[ ! -d /srv/openerp/instances/$name ]]; then
97
log_echo "There isn't any instance named $name"
102
log_echo "Restoring addons for $name"
103
mkserver_addons_rm_links
104
mkserver_install_addons