IDEMPIERE-4441 FreeBSD find utility requires a target directory in postgresql/SyncDB.sh (#245)
Verify all scripts with shellcheck https://www.shellcheck.net/
This commit is contained in:
parent
e72dfd66c0
commit
970936d08c
|
@ -37,7 +37,7 @@ then
|
|||
Please run first install.app or install.console.app within eclipse"
|
||||
exit 1
|
||||
fi
|
||||
cd "$IDEMPIERE_HOME" || exit
|
||||
cd "$IDEMPIERE_HOME" || (echo "Cannot cd to $IDEMPIERE_HOME"; exit 1)
|
||||
CONN=$(grep "^Connection=.*type" "$PROPFILE")
|
||||
if [ -z "$CONN" ]
|
||||
then
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
echo Setup idempiere Server
|
||||
echo Setup iDempiere Server
|
||||
# $Header: /cvsroot/adempiere/install/Adempiere/RUN_setup.sh,v 1.19 2005/09/08 21:54:12 jjanke Exp $
|
||||
|
||||
if [ $JAVA_HOME ]; then
|
||||
if [ "$JAVA_HOME" ]; then
|
||||
JAVA=$JAVA_HOME/bin/java
|
||||
KEYTOOL=$JAVA_HOME/bin/keytool
|
||||
else
|
||||
JAVA=java
|
||||
KEYTOOL=keytool
|
||||
echo JAVA_HOME is not set.
|
||||
echo You may not be able to start the Setup
|
||||
echo Set JAVA_HOME to the directory of your local JDK.
|
||||
|
@ -24,7 +22,7 @@ $JAVA -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install setup -configur
|
|||
echo ===================================
|
||||
echo Make .sh executable & set Env
|
||||
echo ===================================
|
||||
chmod -R a+x *.sh
|
||||
chmod -R a+x -- *.sh
|
||||
find . -name '*.sh' -exec chmod a+x '{}' \;
|
||||
|
||||
echo .
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
unset DISPLAY
|
||||
BASE=`dirname $( readlink -f $0 )`
|
||||
. $BASE/utils/myEnvironment.sh Server
|
||||
if [ $JAVA_HOME ]; then
|
||||
BASE=$(dirname "$( readlink -f "$0" )")
|
||||
export ID_ENV=Server
|
||||
. "$BASE"/utils/myEnvironment.sh
|
||||
if [ "$JAVA_HOME" ]; then
|
||||
JAVA=$JAVA_HOME/bin/java
|
||||
else
|
||||
JAVA=java
|
||||
|
@ -40,4 +41,4 @@ VMOPTS="-Dorg.osgi.framework.bootdelegation=sun.security.ssl,org.w3c.dom.events
|
|||
--add-modules=ALL-SYSTEM
|
||||
--add-modules java.se --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-exports java.desktop/sun.awt=ALL-UNNAMED --add-exports java.sql.rowset/com.sun.rowset=ALL-UNNAMED --add-exports java.naming/com.sun.jndi.ldap=ALL-UNNAMED"
|
||||
|
||||
$JAVA ${DEBUG} $IDEMPIERE_JAVA_OPTIONS $VMOPTS -jar $BASE/plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.server.application
|
||||
$JAVA ${DEBUG} $IDEMPIERE_JAVA_OPTIONS $VMOPTS -jar "$BASE"/plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.server.application
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
echo ... Setup idempiere Server
|
||||
echo ... Setup iDempiere Server
|
||||
# $Header: /cvsroot/adempiere/install/Adempiere/RUN_setup.sh,v 1.19 2005/09/08 21:54:12 jjanke Exp $
|
||||
|
||||
if [ $JAVA_HOME ]; then
|
||||
if [ "$JAVA_HOME" ]; then
|
||||
JAVA=$JAVA_HOME/bin/java
|
||||
KEYTOOL=$JAVA_HOME/bin/keytool
|
||||
else
|
||||
JAVA=java
|
||||
KEYTOOL=keytool
|
||||
echo JAVA_HOME is not set.
|
||||
echo You may not be able to start the Setup
|
||||
echo Set JAVA_HOME to the directory of your local JDK.
|
||||
|
@ -22,7 +20,7 @@ echo ... Setup Jetty
|
|||
$JAVA -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install setup -configuration setup/configuration -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
|
||||
echo ... Make .sh executable
|
||||
chmod -R a+x *.sh
|
||||
chmod -R a+x -- *.sh
|
||||
find . -name '*.sh' -exec chmod a+x '{}' \;
|
||||
|
||||
echo ...
|
||||
|
|
|
@ -10,7 +10,7 @@ echo ... Setup Jetty
|
|||
./idempiere --launcher.ini setup.ini -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
|
||||
echo ... Make .sh executable
|
||||
chmod -R a+x *.sh
|
||||
chmod -R a+x -- *.sh
|
||||
find . -name '*.sh' -exec chmod a+x '{}' \;
|
||||
|
||||
echo ...
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
if [ $JAVA_HOME ]; then
|
||||
if [ "$JAVA_HOME" ]; then
|
||||
JAVA=$JAVA_HOME/bin/java
|
||||
else
|
||||
JAVA=java
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
else
|
||||
cd "`dirname $0`"
|
||||
cd "$(dirname "$0")" || (echo "Cannot cd "; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
|
||||
if [ $JAVA_HOME ]; then
|
||||
if [ "$JAVA_HOME" ]; then
|
||||
JAVA=$JAVA_HOME/bin/java
|
||||
else
|
||||
JAVA=java
|
||||
fi
|
||||
|
||||
# $Id: RUN_ApplyPackInFromFolder.sh
|
||||
echo Apply PackIn from Folder - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
echo Apply PackIn from Folder - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
if [ $# -eq 1 ]
|
||||
then
|
||||
|
@ -24,11 +25,11 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
cd ..
|
||||
cd .. || (echo "Cannot cd .."; exit 1)
|
||||
|
||||
echo This Procedure import packin files from directory $DIRECTORY
|
||||
echo This Procedure import packin files from directory "$DIRECTORY"
|
||||
|
||||
$JAVA -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=false -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.base.PackInFolderApplication $DIRECTORY
|
||||
$JAVA -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=false -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.base.PackInFolderApplication "$DIRECTORY"
|
||||
|
||||
echo Done
|
||||
echo .
|
||||
|
|
|
@ -2,20 +2,21 @@
|
|||
|
||||
# Author + Copyright 1999-2005 Jorg Janke
|
||||
# $Id: RUN_DBExport.sh,v 1.10 2005/05/31 18:45:33 jjanke Exp $
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Export idempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Export idempiere Database - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
|
||||
# Parameter: <adempiereDBuser>/<adempiereDBpassword>
|
||||
sh $ADEMPIERE_DB_PATH/DBExport.sh "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD"
|
||||
sh "$ADEMPIERE_DB_PATH"/DBExport.sh "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD"
|
||||
|
||||
# sh $ADEMPIERE_DB_PATH/DBExportFull.sh system/$ADEMPIERE_DB_SYSTEM
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
sh myDBcopy.sh
|
||||
|
||||
|
|
|
@ -2,20 +2,21 @@
|
|||
|
||||
# Author + Copyright 1999-2005 Jorg Janke
|
||||
# $Id: RUN_DBExport.sh,v 1.10 2005/05/31 18:45:33 jjanke Exp $
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Export idempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Export idempiere Database - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
|
||||
# Parameter: <adempiereDBuser>/<adempiereDBpassword>
|
||||
sh $ADEMPIERE_DB_PATH/DBExportdp.sh $ADEMPIERE_DB_USER $ADEMPIERE_DB_PASSWORD system/$ADEMPIERE_DB_SYSTEM
|
||||
sh "$ADEMPIERE_DB_PATH"/DBExportdp.sh "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" system/"$ADEMPIERE_DB_SYSTEM"
|
||||
|
||||
# sh $ADEMPIERE_DB_PATH/DBExportFulldp.sh system/$ADEMPIERE_DB_SYSTEM
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
sh myDBcopy.sh
|
||||
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: RUN_DBRestore.sh,v 1.9 2005/01/22 21:59:15 jjanke Exp $
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Restore idempiere Database from Export- $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Restore idempiere Database from Export- "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
|
||||
echo Re-Create idempiere User and import $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
echo == The import will show warnings. This is OK ==
|
||||
ls -lsa $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
echo Re-Create idempiere User and import "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
echo "== The import will show warnings. This is OK =="
|
||||
ls -lsa "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
echo Press enter to continue ...
|
||||
read in
|
||||
read -r _
|
||||
|
||||
# Parameter: <systemAccount> <adempiereID> <adempierePwd>
|
||||
# globalqss - cruiz - 2007-10-09 - added fourth parameter for postgres(ignored in oracle)
|
||||
$ADEMPIERE_DB_PATH/DBRestore.sh "system/$ADEMPIERE_DB_SYSTEM" "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" "$ADEMPIERE_DB_SYSTEM"
|
||||
"$ADEMPIERE_DB_PATH"/DBRestore.sh "system/$ADEMPIERE_DB_SYSTEM" "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" "$ADEMPIERE_DB_SYSTEM"
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: RUN_DBRestore.sh,v 1.9 2005/01/22 21:59:15 jjanke Exp $
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Restore idempiere Database from Export- $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Restore idempiere Database from Export- "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
|
||||
echo Re-Create idempiere User and import $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
echo == The import will show warnings. This is OK ==
|
||||
ls -lsa $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
echo Re-Create idempiere User and import "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
echo "== The import will show warnings. This is OK =="
|
||||
ls -lsa "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
echo Press enter to continue ...
|
||||
read in
|
||||
read -r _
|
||||
|
||||
# Parameter: <systemAccount> <adempiereID> <adempierePwd>
|
||||
# globalqss - cruiz - 2007-10-09 - added fourth parameter for postgres(ignored in oracle)
|
||||
$ADEMPIERE_DB_PATH/DBRestoredp.sh system/$ADEMPIERE_DB_SYSTEM $ADEMPIERE_DB_USER $ADEMPIERE_DB_PASSWORD $ADEMPIERE_DB_SYSTEM
|
||||
"$ADEMPIERE_DB_PATH"/DBRestoredp.sh system/"$ADEMPIERE_DB_SYSTEM" "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" "$ADEMPIERE_DB_SYSTEM"
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: RUN_DBStart.sh,v 1.4 2005/01/22 21:59:15 jjanke Exp $
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Start DataBase Service - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Start DataBase Service - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
|
||||
sh $ADEMPIERE_DB_PATH/Start.sh
|
||||
sh "$ADEMPIERE_DB_PATH"/Start.sh
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: RUN_DBStop.sh,v 1.4 2005/01/22 21:59:15 jjanke Exp $
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Stop DataBase Service - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Stop DataBase Service - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
|
||||
sh $ADEMPIERE_DB_PATH/Stop.sh
|
||||
sh "$ADEMPIERE_DB_PATH"/Stop.sh
|
||||
|
||||
|
|
|
@ -3,54 +3,54 @@
|
|||
# $Id: RUN_Env.sh,v 1.16 2005/01/22 21:59:15 jjanke Exp $
|
||||
echo idempiere Environment Check
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
# Environment is read from the following script myEnvironment.sh
|
||||
. ./myEnvironment.sh
|
||||
|
||||
echo General ...
|
||||
echo PATH = $PATH
|
||||
echo CLASSPTH = $CLASSPATH
|
||||
echo PATH = "$PATH"
|
||||
echo CLASSPTH = "$CLASSPATH"
|
||||
|
||||
echo .
|
||||
echo Homes ...
|
||||
echo IDEMPIERE_HOME = $IDEMPIERE_HOME
|
||||
echo JAVA_HOME = $JAVA_HOME
|
||||
echo ADEMPIERE_DB_URL = $ADEMPIERE_DB_URL
|
||||
echo IDEMPIERE_HOME = "$IDEMPIERE_HOME"
|
||||
echo JAVA_HOME = "$JAVA_HOME"
|
||||
echo ADEMPIERE_DB_URL = "$ADEMPIERE_DB_URL"
|
||||
|
||||
echo .
|
||||
echo Database ...
|
||||
echo ADEMPIERE_DB_USER = $ADEMPIERE_DB_USER
|
||||
echo ADEMPIERE_DB_PASSWORD = $ADEMPIERE_DB_PASSWORD
|
||||
echo ADEMPIERE_DB_PATH = $ADEMPIERE_DB_PATH
|
||||
echo ADEMPIERE_DB_USER = "$ADEMPIERE_DB_USER"
|
||||
echo ADEMPIERE_DB_PASSWORD = "$ADEMPIERE_DB_PASSWORD"
|
||||
echo ADEMPIERE_DB_PATH = "$ADEMPIERE_DB_PATH"
|
||||
|
||||
echo .. Oracle specifics
|
||||
echo ADEMPIERE_DB_NAME = $ADEMPIERE_DB_NAME
|
||||
echo ADEMPIERE_DB_SYSTEM = $ADEMPIERE_DB_SYSTEM
|
||||
echo ADEMPIERE_DB_NAME = "$ADEMPIERE_DB_NAME"
|
||||
echo ADEMPIERE_DB_SYSTEM = "$ADEMPIERE_DB_SYSTEM"
|
||||
|
||||
echo .
|
||||
echo Java Test ... should be 1.6+
|
||||
$JAVA_HOME/bin/java -version
|
||||
"$JAVA_HOME"/bin/java -version
|
||||
|
||||
echo .
|
||||
echo Database Connection Test \(1\) ... TNS
|
||||
echo Running tnsping $ADEMPIERE_DB_NAME
|
||||
tnsping $ADEMPIERE_DB_NAME
|
||||
echo Running tnsping "$ADEMPIERE_DB_NAME"
|
||||
tnsping "$ADEMPIERE_DB_NAME"
|
||||
|
||||
echo .
|
||||
echo Database Connection Test \(2\)... System
|
||||
echo Running sqlplus system/$ADEMPIERE_DB_SYS@$ADEMPIERE_DB_NAME @$ADEMPIERE_DB_PATH/Test.sql
|
||||
sqlplus system/$ADEMPIERE_DB_SYSTEM@$ADEMPIERE_DB_NAME @$ADEMPIERE_DB_HOME/Test.sql
|
||||
echo Running sqlplus system/"$ADEMPIERE_DB_SYS"@"$ADEMPIERE_DB_NAME" @"$ADEMPIERE_DB_PATH"/Test.sql
|
||||
sqlplus system/"$ADEMPIERE_DB_SYSTEM"@"$ADEMPIERE_DB_NAME" @"$ADEMPIERE_DB_HOME"/Test.sql
|
||||
|
||||
echo .
|
||||
echo Checking Database Size \(3\)
|
||||
sqlplus system/$ADEMPIERE_DB_SYSTEM@$ADEMPIERE_DB_NAME @$ADEMPIERE_DB_HOME/CheckDB.sql $ADEMPIERE_DB_USER
|
||||
sqlplus system/"$ADEMPIERE_DB_SYSTEM"@"$ADEMPIERE_DB_NAME" @"$ADEMPIERE_DB_HOME"/CheckDB.sql "$ADEMPIERE_DB_USER"
|
||||
|
||||
echo .
|
||||
echo == It is ok for the next to fail before the Adempiere Database Import Step ==
|
||||
echo Database Connection Test \(4\) ... Adempiere \(May not work, if not user not yet imported\)
|
||||
sqlplus $ADEMPIERE_DB_USER/$ADEMPIERE_DB_PASSWORD@$ADEMPIERE_DB_NAME @$ADEMPIERE_DB_HOME/Test.sql
|
||||
echo "== It is ok for the next to fail before the iDempiere Database Import Step =="
|
||||
echo Database Connection Test \(4\) ... iDempiere \(May not work, if not user not yet imported\)
|
||||
sqlplus "$ADEMPIERE_DB_USER"/"$ADEMPIERE_DB_PASSWORD"@"$ADEMPIERE_DB_NAME" @"$ADEMPIERE_DB_HOME"/Test.sql
|
||||
|
||||
echo .
|
||||
echo Done
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
|
||||
# Author + Copyright 1999-2005 Jorg Janke
|
||||
# $Id: RUN_DBExport.sh,v 1.10 2005/05/31 18:45:33 jjanke Exp $
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Export idempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Export idempiere Database - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
|
||||
# Parameter: <adempiereDBuser>/<adempiereDBpassword>
|
||||
sh $ADEMPIERE_DB_PATH/ExportReference.sh $ADEMPIERE_DB_USER $ADEMPIERE_DB_PASSWORD system/$ADEMPIERE_DB_SYSTEM
|
||||
sh "$ADEMPIERE_DB_PATH"/ExportReference.sh "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" system/"$ADEMPIERE_DB_SYSTEM"
|
||||
|
|
|
@ -2,29 +2,30 @@
|
|||
#
|
||||
# $Id: RUN_ImportIdempiere.sh,v 1.9 2005/01/22 21:59:15 jjanke Exp $
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Import idempiere - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Import idempiere - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
SUFFIX=""
|
||||
SYSUSER=system
|
||||
if [ $ADEMPIERE_DB_PATH = "postgresql" ]
|
||||
if [ "$ADEMPIERE_DB_PATH" = "postgresql" ]
|
||||
then
|
||||
SUFFIX="_pg"
|
||||
SYSUSER=postgres
|
||||
fi
|
||||
|
||||
echo Re-Create idempiere User and import $IDEMPIERE_HOME/data/Adempiere${SUFFIX}.dmp - \($ADEMPIERE_DB_NAME\)
|
||||
echo == The import will show warnings. This is OK ==
|
||||
cd $IDEMPIERE_HOME/data/seed
|
||||
echo Re-Create idempiere User and import "$IDEMPIERE_HOME"/data/Adempiere${SUFFIX}.dmp - \("$ADEMPIERE_DB_NAME"\)
|
||||
echo "== The import will show warnings. This is OK =="
|
||||
cd "$IDEMPIERE_HOME"/data/seed || exit
|
||||
jar xvf Adempiere${SUFFIX}.jar
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
ls -lsa $IDEMPIERE_HOME/data/seed/Adempiere${SUFFIX}.dmp
|
||||
cd "$IDEMPIERE_HOME"/utils || exit
|
||||
ls -lsa "$IDEMPIERE_HOME"/data/seed/Adempiere${SUFFIX}.dmp
|
||||
echo Press enter to continue ...
|
||||
read in
|
||||
read -r _
|
||||
|
||||
# Parameter: <systemAccount> <AdempiereID> <AdempierePwd>
|
||||
# globalqss - cruiz - 2007-10-09 - added fourth parameter for postgres(ignored in oracle)
|
||||
$ADEMPIERE_DB_PATH/ImportIdempiere.sh "$SYSUSER/$ADEMPIERE_DB_SYSTEM" "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" "$ADEMPIERE_DB_SYSTEM" "$SUFFIX"
|
||||
"$ADEMPIERE_DB_PATH"/ImportIdempiere.sh "$SYSUSER/$ADEMPIERE_DB_SYSTEM" "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" "$ADEMPIERE_DB_SYSTEM" "$SUFFIX"
|
||||
|
|
|
@ -2,25 +2,26 @@
|
|||
#
|
||||
# $Id: RUN_ImportReference.sh,v 1.11 2005/12/13 00:17:54 jjanke Exp $
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Import Reference - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Import Reference - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
SUFFIX=""
|
||||
SYSUSER=system
|
||||
if [ $ADEMPIERE_DB_PATH = "postgresql" ]
|
||||
if [ "$ADEMPIERE_DB_PATH" = "postgresql" ]
|
||||
then
|
||||
SUFFIX="_pg"
|
||||
SYSUSER=postgres
|
||||
fi
|
||||
|
||||
echo Re-Create Reference User and import $IDEMPIERE_HOME/data/Adempiere.dmp - \($ADEMPIERE_DB_NAME\)
|
||||
echo == The import will show warnings. This is OK ==
|
||||
ls -lsa $IDEMPIERE_HOME/data/Adempiere${SUFFIX}.dmp
|
||||
echo Re-Create Reference User and import "$IDEMPIERE_HOME"/data/Adempiere.dmp - \("$ADEMPIERE_DB_NAME"\)
|
||||
echo "== The import will show warnings. This is OK =="
|
||||
ls -lsa "$IDEMPIERE_HOME"/data/Adempiere${SUFFIX}.dmp
|
||||
echo Press enter to continue ...
|
||||
read in
|
||||
read -r _
|
||||
|
||||
# Parameter: <systemAccount> <AdempiereID> <AdempierePwd>
|
||||
sh $ADEMPIERE_DB_PATH/ImportIdempiere.sh $SYSUSER/$ADEMPIERE_DB_SYSTEM reference reference $ADEMPIERE_DB_SYSTEM
|
||||
sh "$ADEMPIERE_DB_PATH"/ImportIdempiere.sh $SYSUSER/"$ADEMPIERE_DB_SYSTEM" reference reference "$ADEMPIERE_DB_SYSTEM"
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Author Carlos Ruiz
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Synchronize iDempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Synchronize iDempiere Database - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
bash $ADEMPIERE_DB_PATH/MonitoredSyncDB.sh "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" "$ADEMPIERE_DB_PATH" $*
|
||||
bash "$ADEMPIERE_DB_PATH"/MonitoredSyncDB.sh "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" "$ADEMPIERE_DB_PATH" $*
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
#
|
||||
# $Id: RUN_PostMigration.sh
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
|
||||
#check java home
|
||||
if [ $JAVA_HOME ]; then
|
||||
if [ "$JAVA_HOME" ]; then
|
||||
export PATH=$JAVA_HOME/bin:$PATH
|
||||
else
|
||||
echo JAVA_HOME is not set.
|
||||
|
@ -17,7 +18,7 @@ else
|
|||
exit
|
||||
fi
|
||||
|
||||
cd $IDEMPIERE_HOME
|
||||
cd "$IDEMPIERE_HOME" || (echo "Cannot cd to $IDEMPIERE_HOME"; exit 1)
|
||||
|
||||
./idempiere --launcher.ini setup.ini -application org.adempiere.base.PostMigration -consoleLog
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Author Carlos Ruiz
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot change to $IDEMPIERE_HOME/utils"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
echo Synchronize iDempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
echo Synchronize iDempiere Database - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
sh $ADEMPIERE_DB_PATH/SyncDB.sh "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" "$ADEMPIERE_DB_PATH" $*
|
||||
sh "$ADEMPIERE_DB_PATH"/SyncDB.sh "$ADEMPIERE_DB_USER" "$ADEMPIERE_DB_PASSWORD" "$ADEMPIERE_DB_PATH" $*
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
else
|
||||
cd "`dirname $0`"
|
||||
cd "$(dirname "$0")" || (echo "Cannot cd"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
|
||||
if [ $JAVA_HOME ]; then
|
||||
if [ "$JAVA_HOME" ]; then
|
||||
JAVA=$JAVA_HOME/bin/java
|
||||
else
|
||||
JAVA=java
|
||||
fi
|
||||
|
||||
# RUN_SyncTerm.sh
|
||||
echo Synchronize idempiere Terminology - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
echo Synchronize idempiere Terminology - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
cd ..
|
||||
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
else
|
||||
cd "`dirname $0`"
|
||||
cd "$(dirname "$0")" || (echo "Cannot cd"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
|
||||
if [ $JAVA_HOME ]; then
|
||||
if [ "$JAVA_HOME" ]; then
|
||||
JAVA=$JAVA_HOME/bin/java
|
||||
else
|
||||
JAVA=java
|
||||
fi
|
||||
|
||||
# $Id: RUN_TrlExport.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $
|
||||
echo Export idempiere Translation - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
echo Export idempiere Translation - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
|
@ -33,9 +34,9 @@ fi
|
|||
|
||||
cd ..
|
||||
|
||||
echo This Procedure exports language $AD_LANGUAGE to directory $DIRECTORY
|
||||
echo This Procedure exports language $AD_LANGUAGE to directory "$DIRECTORY"
|
||||
|
||||
$JAVA -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=false -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.install.translation export $DIRECTORY $AD_LANGUAGE
|
||||
$JAVA -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=false -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.install.translation export "$DIRECTORY" $AD_LANGUAGE
|
||||
|
||||
echo Done
|
||||
echo .
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
if [ "$IDEMPIERE_HOME" ]; then
|
||||
cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
|
||||
else
|
||||
cd "`dirname $0`"
|
||||
cd "$(dirname "$0")" || (echo "Cannot cd"; exit 1)
|
||||
fi
|
||||
. ./myEnvironment.sh Server
|
||||
export ID_ENV=Server
|
||||
. ./myEnvironment.sh
|
||||
|
||||
if [ $JAVA_HOME ]; then
|
||||
if [ "$JAVA_HOME" ]; then
|
||||
JAVA=$JAVA_HOME/bin/java
|
||||
else
|
||||
JAVA=java
|
||||
fi
|
||||
|
||||
# $Id: RUN_TrlImport.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $
|
||||
echo Import idempiere Translation - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
echo Import idempiere Translation - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
|
||||
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
|
@ -33,9 +34,9 @@ fi
|
|||
|
||||
cd ..
|
||||
|
||||
echo This Procedure imports language $AD_LANGUAGE from directory $DIRECTORY
|
||||
echo This Procedure imports language $AD_LANGUAGE from directory "$DIRECTORY"
|
||||
|
||||
$JAVA -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=false -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.install.translation import $DIRECTORY $AD_LANGUAGE
|
||||
$JAVA -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=false -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.install.translation import "$DIRECTORY" $AD_LANGUAGE
|
||||
|
||||
echo Done
|
||||
echo .
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
echo Set Unix Environment
|
||||
# $Id: RUN_UnixEnvTemplate.sh,v 1.3 2004/03/11 05:41:13 jjanke Exp $
|
||||
|
||||
echo ===================================
|
||||
echo Setup Client Environment
|
||||
echo ===================================
|
||||
echo "==================================="
|
||||
echo "Setup Client Environment"
|
||||
echo "==================================="
|
||||
|
||||
JAVA_HOME=@JAVA_HOME@
|
||||
export JAVA_HOME
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
# Copy Database after backup
|
||||
# $Id: myDBcopyTemplate.sh,v 1.1 2002/10/07 01:23:32 jjanke Exp $
|
||||
|
||||
DATE=`date +%Y%m%d_%H%M%S`
|
||||
mv $IDEMPIERE_HOME/data/ExpDat.jar $IDEMPIERE_HOME/data/ExpDat$DATE.jar
|
||||
echo copy $IDEMPIERE_HOME/data/ExpDat$DATE.jar to backup media
|
||||
DATE=$(date +%Y%m%d_%H%M%S)
|
||||
mv "$IDEMPIERE_HOME"/data/ExpDat.jar "$IDEMPIERE_HOME"/data/ExpDat"$DATE".jar
|
||||
echo copy "$IDEMPIERE_HOME"/data/ExpDat"$DATE".jar to backup media
|
||||
|
|
|
@ -67,7 +67,7 @@ export ADEMPIERE_JAVA
|
|||
IDEMPIERE_JAVA_OPTIONS="@IDEMPIERE_JAVA_OPTIONS@ -DIDEMPIERE_HOME=$IDEMPIERE_HOME"
|
||||
export IDEMPIERE_JAVA_OPTIONS
|
||||
|
||||
if [ $DOLLAR$# -eq 0 ]
|
||||
then
|
||||
if [ "$ID_ENV" != "Server" ]
|
||||
then
|
||||
cp $IDEMPIERE_HOME/utils/myEnvironment.sh $IDEMPIERE_HOME/utils/myEnvironment.sav
|
||||
fi
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo Adempiere Database Export $Revision: 1.5 $
|
||||
echo iDempiere Database Export "$Revision": 1.5 $
|
||||
|
||||
# $Id: DBExport.sh,v 1.5 2005/12/20 07:12:17 jjanke Exp $
|
||||
|
||||
echo Saving database $1@$ADEMPIERE_DB_NAME to $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
echo Saving database "$1"@"$ADEMPIERE_DB_NAME" to "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
|
@ -12,7 +12,7 @@ if [ $# -eq 0 ]
|
|||
echo "Example: $0 adempiere adempiere"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -21,10 +21,10 @@ if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
|||
fi
|
||||
|
||||
# Cleanup
|
||||
sqlplus $1/$2@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Daily.sql
|
||||
sqlplus "$1"/"$2"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/Daily.sql
|
||||
|
||||
# Export
|
||||
exp $1/$2@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME FILE=$IDEMPIERE_HOME/data/ExpDat.dmp Log=$IDEMPIERE_HOME/data/ExpDat.log CONSISTENT=Y STATISTICS=NONE OWNER=$1
|
||||
exp "$1"/"$2"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" FILE="$IDEMPIERE_HOME"/data/ExpDat.dmp Log="$IDEMPIERE_HOME"/data/ExpDat.log CONSISTENT=Y STATISTICS=NONE OWNER="$1"
|
||||
|
||||
cd $IDEMPIERE_HOME/data
|
||||
cd "$IDEMPIERE_HOME"/data || exit
|
||||
jar cvfM ExpDat.jar ExpDat.dmp ExpDat.log
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo Adempiere Full Database Export $Revision: 1.3 $
|
||||
echo iDempiere Full Database Export "$Revision": 1.3 $
|
||||
|
||||
# $Id: DBExportFull.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $
|
||||
|
||||
echo Saving database $1@$ADEMPIERE_DB_NAME to $IDEMPIERE_HOME/data/ExpDatFull.dmp
|
||||
echo Saving database "$1"@"$ADEMPIERE_DB_NAME" to "$IDEMPIERE_HOME"/data/ExpDatFull.dmp
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
|
@ -12,7 +12,7 @@ if [ $# -eq 0 ]
|
|||
echo "Example: $0 system/manager"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -20,8 +20,8 @@ if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
|||
exit 1
|
||||
fi
|
||||
|
||||
exp $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME FILE=$IDEMPIERE_HOME/data/ExpDatFull.dmp Log=$IDEMPIERE_HOME/data/ExpDatFull.log CONSISTENT=Y STATISTICS=NONE FULL=Y
|
||||
exp "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" FILE="$IDEMPIERE_HOME"/data/ExpDatFull.dmp Log="$IDEMPIERE_HOME"/data/ExpDatFull.log CONSISTENT=Y STATISTICS=NONE FULL=Y
|
||||
|
||||
cd $IDEMPIERE_HOME/data
|
||||
cd "$IDEMPIERE_HOME"/data || exit
|
||||
jar cvfM ExpDatFull.jar ExpDatFull.dmp ExpDatFull.log
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo Adempiere Full Database Export $Revision: 1.3 $
|
||||
echo iDempiere Full Database Export "$Revision": 1.3 $
|
||||
|
||||
# $Id: DBExportFull.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $
|
||||
|
||||
DATE=`date +%Y%m%d_%H%M%S`
|
||||
echo Saving database $1@$ADEMPIERE_DB_NAME to $IDEMPIERE_HOME/data/ExpDatFull_$DATE.dmp
|
||||
DATE=$(date +%Y%m%d_%H%M%S)
|
||||
echo Saving database "$1"@"$ADEMPIERE_DB_NAME" to "$IDEMPIERE_HOME"/data/ExpDatFull_"$DATE".dmp
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
|
@ -13,7 +13,7 @@ if [ $# -eq 0 ]
|
|||
echo "Example: $0 system/manager"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -24,12 +24,12 @@ fi
|
|||
echo -------------------------------------
|
||||
echo Re-Create DataPump directory
|
||||
echo -------------------------------------
|
||||
sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data
|
||||
chgrp dba $IDEMPIERE_HOME/data
|
||||
chmod 770 $IDEMPIERE_HOME/data
|
||||
sqlplus "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateDataPumpDir.sql "$IDEMPIERE_HOME"/data
|
||||
chgrp dba "$IDEMPIERE_HOME"/data
|
||||
chmod 770 "$IDEMPIERE_HOME"/data
|
||||
|
||||
expdp $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=ExpDatFull_$DATE.dmp LOGFILE=ExpDatFull_$DATE.log EXCLUDE=STATISTICS FULL=Y
|
||||
expdp "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=ExpDatFull_"$DATE".dmp LOGFILE=ExpDatFull_"$DATE".log EXCLUDE=STATISTICS FULL=Y
|
||||
|
||||
cd $IDEMPIERE_HOME/data
|
||||
jar cvfM ExpDatFull.jar ExpDatFull_$DATE.dmp ExpDatFull_$DATE.log
|
||||
cd "$IDEMPIERE_HOME"/data || exit
|
||||
jar cvfM ExpDatFull.jar ExpDatFull_"$DATE".dmp ExpDatFull_"$DATE".log
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo Adempiere Database Export $Revision: 1.5 $
|
||||
echo iDempiere Database Export "$Revision": 1.5 $
|
||||
|
||||
# $Id: DBExport.sh,v 1.5 2005/12/20 07:12:17 jjanke Exp $
|
||||
|
||||
DATE=`date +%Y%m%d_%H%M%S`
|
||||
echo Saving database $1@$ADEMPIERE_DB_NAME to $IDEMPIERE_HOME/data/ExpDat_$DATE.dmp
|
||||
DATE=$(date +%Y%m%d_%H%M%S)
|
||||
echo Saving database "$1"@"$ADEMPIERE_DB_NAME" to "$IDEMPIERE_HOME"/data/ExpDat_"$DATE".dmp
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
|
@ -13,7 +13,7 @@ if [ $# -eq 0 ]
|
|||
echo "Example: $0 adempiere adempiere"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -22,17 +22,17 @@ if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
|||
fi
|
||||
|
||||
# Cleanup
|
||||
sqlplus $1/$2@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Daily.sql
|
||||
sqlplus "$1"/"$2"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/Daily.sql
|
||||
|
||||
echo -------------------------------------
|
||||
echo Re-Create DataPump directory
|
||||
echo -------------------------------------
|
||||
sqlplus $3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data
|
||||
chgrp dba $IDEMPIERE_HOME/data
|
||||
chmod 770 $IDEMPIERE_HOME/data
|
||||
sqlplus "$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateDataPumpDir.sql "$IDEMPIERE_HOME"/data
|
||||
chgrp dba "$IDEMPIERE_HOME"/data
|
||||
chmod 770 "$IDEMPIERE_HOME"/data
|
||||
|
||||
# Export
|
||||
expdp $1/$2@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=ExpDat_$DATE.dmp LOGFILE=ExpDat_$DATE.log EXCLUDE=STATISTICS SCHEMAS=$1
|
||||
expdp "$1"/"$2"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=ExpDat_"$DATE".dmp LOGFILE=ExpDat_"$DATE".log EXCLUDE=STATISTICS SCHEMAS="$1"
|
||||
|
||||
cd $IDEMPIERE_HOME/data
|
||||
jar cvfM ExpDat.jar ExpDat_$DATE.dmp ExpDat_$DATE.log
|
||||
cd "$IDEMPIERE_HOME"/data || exit
|
||||
jar cvfM ExpDat.jar ExpDat_"$DATE".dmp ExpDat_"$DATE".log
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: DBRestore.sh,v 1.8 2005/12/20 07:12:17 jjanke Exp $
|
||||
echo idempiere Database Restore $Revision: 1.8 $
|
||||
echo iDempiere Database Restore "$Revision": 1.8 $
|
||||
|
||||
echo Restoring idempiere DB from $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
echo Restoring idempiere DB from "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
|
||||
if [ $# -le 2 ]
|
||||
then
|
||||
|
@ -11,7 +11,7 @@ if [ $# -le 2 ]
|
|||
echo "Example: $0 system/manager adempiere adempiere"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -23,15 +23,15 @@ fi
|
|||
echo -------------------------------------
|
||||
echo Re-Create DB user
|
||||
echo -------------------------------------
|
||||
sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql $2 $3
|
||||
sqlplus "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateUser.sql "$2" "$3"
|
||||
|
||||
echo -------------------------------------
|
||||
echo Import ExpDat
|
||||
echo -------------------------------------
|
||||
imp $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME FILE=$IDEMPIERE_HOME/data/ExpDat.dmp FROMUSER=\($2\) TOUSER=$2
|
||||
imp "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" FILE="$IDEMPIERE_HOME"/data/ExpDat.dmp FROMUSER=\("$2"\) TOUSER="$2"
|
||||
|
||||
echo -------------------------------------
|
||||
echo Check System
|
||||
echo Import may show some warnings. This is OK as long as the following does not show errors
|
||||
echo -------------------------------------
|
||||
sqlplus $2/$3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql
|
||||
sqlplus "$2"/"$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/AfterImport.sql
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: DBRestore.sh,v 1.8 2005/12/20 07:12:17 jjanke Exp $
|
||||
echo Adempiere Database Restore $Revision: 1.8 $
|
||||
echo iDempiere Database Restore "$Revision": 1.8 $
|
||||
|
||||
echo Restoring Adempiere DB from $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
echo Restoring iDempiere DB from "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
|
||||
if [ $# -le 2 ]
|
||||
then
|
||||
|
@ -11,7 +11,7 @@ if [ $# -le 2 ]
|
|||
echo "Example: $0 system/manager adempiere adempiere"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -23,25 +23,25 @@ fi
|
|||
echo -------------------------------------
|
||||
echo Re-Create DB user
|
||||
echo -------------------------------------
|
||||
sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql $2 $3
|
||||
sqlplus "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateUser.sql "$2" "$3"
|
||||
|
||||
echo -------------------------------------
|
||||
echo Re-Create DataPump directory
|
||||
echo -------------------------------------
|
||||
sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data
|
||||
sqlplus "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateDataPumpDir.sql "$IDEMPIERE_HOME"/data
|
||||
# Note the user running this script must be member of dba group: usermod -G dba idempiere
|
||||
chgrp dba $IDEMPIERE_HOME/data
|
||||
chmod 770 $IDEMPIERE_HOME/data
|
||||
chgrp dba $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
chmod 640 $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
chgrp dba "$IDEMPIERE_HOME"/data
|
||||
chmod 770 "$IDEMPIERE_HOME"/data
|
||||
chgrp dba "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
chmod 640 "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
|
||||
echo -------------------------------------
|
||||
echo Import ExpDat
|
||||
echo -------------------------------------
|
||||
impdp $2/$3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=ExpDat.dmp SCHEMAS=$2
|
||||
impdp "$2"/"$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=ExpDat.dmp SCHEMAS="$2"
|
||||
|
||||
echo -------------------------------------
|
||||
echo Check System
|
||||
echo Import may show some warnings. This is OK as long as the following does not show errors
|
||||
echo -------------------------------------
|
||||
sqlplus $2/$3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql
|
||||
sqlplus "$2"/"$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/AfterImport.sql
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo Adempiere Database Export $Revision: 1.5 $
|
||||
echo iDempiere Database Export "$Revision": 1.5 $
|
||||
|
||||
# $Id: ExportReference.sh,v 1.5 2005/12/20 07:12:17 jjanke Exp $
|
||||
|
||||
echo Saving reference database reference@$ADEMPIERE_DB_NAME to $IDEMPIERE_HOME/data/Adempiere.dmp
|
||||
echo Saving reference database reference@"$ADEMPIERE_DB_NAME" to "$IDEMPIERE_HOME"/data/Adempiere.dmp
|
||||
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -17,13 +17,13 @@ fi
|
|||
echo -------------------------------------
|
||||
echo Re-Create DataPump directory
|
||||
echo -------------------------------------
|
||||
sqlplus $3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data
|
||||
chgrp dba $IDEMPIERE_HOME/data
|
||||
chmod 770 $IDEMPIERE_HOME/data
|
||||
sqlplus "$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateDataPumpDir.sql "$IDEMPIERE_HOME"/data
|
||||
chgrp dba "$IDEMPIERE_HOME"/data
|
||||
chmod 770 "$IDEMPIERE_HOME"/data
|
||||
|
||||
if [ "x${1,,}" != "xreference" ]
|
||||
then
|
||||
sqlplus $3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME <<!
|
||||
sqlplus "$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" <<!
|
||||
DROP USER REFERENCE CASCADE;
|
||||
alter session set "_enable_rename_user"=true;
|
||||
alter system enable restricted session;
|
||||
|
@ -32,13 +32,13 @@ alter system disable restricted session;
|
|||
!
|
||||
fi
|
||||
|
||||
rm -f $IDEMPIERE_HOME/data/Adempiere.dmp $IDEMPIERE_HOME/data/Adempiere.log
|
||||
rm -f "$IDEMPIERE_HOME"/data/Adempiere.dmp "$IDEMPIERE_HOME"/data/Adempiere.log
|
||||
# Export
|
||||
expdp REFERENCE/$2@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=Adempiere.dmp LOGFILE=Adempiere.log EXCLUDE=STATISTICS SCHEMAS=REFERENCE
|
||||
expdp REFERENCE/"$2"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=Adempiere.dmp LOGFILE=Adempiere.log EXCLUDE=STATISTICS SCHEMAS=REFERENCE
|
||||
|
||||
if [ "x${1,,}" != "xreference" ]
|
||||
then
|
||||
sqlplus $3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME <<!
|
||||
sqlplus "$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" <<!
|
||||
alter session set "_enable_rename_user"=true;
|
||||
alter system enable restricted session;
|
||||
ALTER USER REFERENCE RENAME TO $1 IDENTIFIED BY "$2";
|
||||
|
@ -46,5 +46,5 @@ alter system disable restricted session;
|
|||
!
|
||||
fi
|
||||
|
||||
cd $IDEMPIERE_HOME/data
|
||||
cd "$IDEMPIERE_HOME"/data || exit
|
||||
jar cvfM Adempiere.jar Adempiere.dmp Adempiere.log
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: ImportAdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $
|
||||
echo idempiere Database Import $Revision: 1.10 $
|
||||
# $Id: ImportIdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $
|
||||
echo iDempiere Database Import "$Revision": 1.10 $
|
||||
|
||||
echo Importing idempiere DB from $IDEMPIERE_HOME/data/seed/Adempiere.dmp
|
||||
echo Importing idempiere DB from "$IDEMPIERE_HOME"/data/seed/Adempiere.dmp
|
||||
|
||||
if [ $# -le 2 ]
|
||||
then
|
||||
|
@ -11,7 +11,7 @@ if [ $# -le 2 ]
|
|||
echo "Example: $0 system/manager idempiere idempiere"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -23,30 +23,30 @@ fi
|
|||
echo -------------------------------------
|
||||
echo Re-Create DB user
|
||||
echo -------------------------------------
|
||||
echo sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql $2 $3
|
||||
sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql $2 $3
|
||||
echo sqlplus "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateUser.sql "$2" "$3"
|
||||
sqlplus "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateUser.sql "$2" "$3"
|
||||
|
||||
echo -------------------------------------
|
||||
echo Re-Create DataPump directory
|
||||
echo -------------------------------------
|
||||
sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data/seed
|
||||
sqlplus "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateDataPumpDir.sql "$IDEMPIERE_HOME"/data/seed
|
||||
# Note the user running this script must be member of dba group: usermod -G dba idempiere
|
||||
chgrp dba $IDEMPIERE_HOME/data
|
||||
chmod 770 $IDEMPIERE_HOME/data
|
||||
chgrp dba $IDEMPIERE_HOME/data/seed
|
||||
chmod 770 $IDEMPIERE_HOME/data/seed
|
||||
chgrp dba $IDEMPIERE_HOME/data/seed/Adempiere.dmp
|
||||
chmod 640 $IDEMPIERE_HOME/data/seed/Adempiere.dmp
|
||||
chgrp dba "$IDEMPIERE_HOME"/data
|
||||
chmod 770 "$IDEMPIERE_HOME"/data
|
||||
chgrp dba "$IDEMPIERE_HOME"/data/seed
|
||||
chmod 770 "$IDEMPIERE_HOME"/data/seed
|
||||
chgrp dba "$IDEMPIERE_HOME"/data/seed/Adempiere.dmp
|
||||
chmod 640 "$IDEMPIERE_HOME"/data/seed/Adempiere.dmp
|
||||
|
||||
echo -------------------------------------
|
||||
echo Import Adempiere.dmp
|
||||
echo -------------------------------------
|
||||
echo "impdp $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=Adempiere.dmp REMAP_SCHEMA=reference:$2"
|
||||
impdp $2/$3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=Adempiere.dmp REMAP_SCHEMA=reference:$2
|
||||
impdp "$2"/"$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=Adempiere.dmp REMAP_SCHEMA=reference:"$2"
|
||||
|
||||
echo -------------------------------------
|
||||
echo Check System
|
||||
echo Import may show some warnings. This is OK as long as the following does not show errors
|
||||
echo -------------------------------------
|
||||
echo sqlplus $2/$3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql
|
||||
sqlplus $2/$3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql
|
||||
echo sqlplus "$2"/"$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/AfterImport.sql
|
||||
sqlplus "$2"/"$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/AfterImport.sql
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: ImportReference.sh,v 1.5 2005/01/22 21:59:15 jjanke Exp $
|
||||
echo Adempiere Reference Database Import $Revision: 1.5 $
|
||||
echo iDempiere Reference Database Import "$Revision": 1.5 $
|
||||
|
||||
echo Importing Reference DB from $IDEMPIERE_HOME/data/Reference.dmp
|
||||
echo Importing Reference DB from "$IDEMPIERE_HOME"/data/Reference.dmp
|
||||
|
||||
if [ $# -eq 2 ]
|
||||
then
|
||||
|
@ -11,7 +11,7 @@ if [ $# -eq 2 ]
|
|||
echo "Example: $0 system/manager"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -23,17 +23,17 @@ fi
|
|||
echo -------------------------------------
|
||||
echo Re-Create new user
|
||||
echo -------------------------------------
|
||||
sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql Reference Adempiere
|
||||
sqlplus "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateUser.sql Reference Adempiere
|
||||
|
||||
echo -------------------------------------
|
||||
echo Import Reference
|
||||
echo -------------------------------------
|
||||
echo imp $1@$ADEMPIERE_DB_NAME FILE=$IDEMPIERE_HOME/data/Reference.dmp FROMUSER=\(reference\) TOUSER=reference
|
||||
imp $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME FILE=$IDEMPIERE_HOME/data/Reference.dmp FROMUSER=\(reference\) TOUSER=reference
|
||||
echo imp "$1"@"$ADEMPIERE_DB_NAME" FILE="$IDEMPIERE_HOME"/data/Reference.dmp FROMUSER=\(reference\) TOUSER=reference
|
||||
imp "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" FILE="$IDEMPIERE_HOME"/data/Reference.dmp FROMUSER=\(reference\) TOUSER=reference
|
||||
|
||||
echo -------------------------------------
|
||||
echo Check System
|
||||
echo Import may show some warnings. This is OK as long as the following does not show errors
|
||||
echo -------------------------------------
|
||||
sqlplus reference/adempiere@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql
|
||||
sqlplus reference/adempiere@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/AfterImport.sql
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ if [ $# -le 2 ]
|
|||
echo "Example: $0 system/manager idempiere idempiere"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -20,4 +20,4 @@ fi
|
|||
echo -------------------------------------
|
||||
echo Add missing translations
|
||||
echo -------------------------------------
|
||||
echo sqlplus $2/$3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/migration/processes_post_migration/$ADEMPIERE_DB_PATH/01_add_missing_Translations.sql
|
||||
echo sqlplus "$2"/"$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/migration/processes_post_migration/"$ADEMPIERE_DB_PATH"/01_add_missing_Translations.sql
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
# $Id: Start.sh,v 1.6 2005/01/22 21:59:15 jjanke Exp $
|
||||
|
||||
sqlplus "system/$ADEMPIERE_DB_SYSTEM@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME AS SYSDBA" @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Start.sql
|
||||
sqlplus "system/$ADEMPIERE_DB_SYSTEM@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME AS SYSDBA" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/Start.sql
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
# SET ORACLE_SID=
|
||||
# export ORACLE_SID
|
||||
|
||||
sqlplus "system/$ADEMPIERE_DB_SYSTEM@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME AS SYSDBA" @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Stop.sql
|
||||
sqlplus "system/$ADEMPIERE_DB_SYSTEM@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME AS SYSDBA" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/Stop.sql
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
echo Synchronize iDempiere Database
|
||||
|
||||
echo Upgrading database $1@$ADEMPIERE_DB_NAME
|
||||
echo Upgrading database "$1@$ADEMPIERE_DB_NAME"
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
|
@ -13,7 +13,7 @@ if [ $# -eq 0 ]
|
|||
echo "Example: $0 adempiere adempiere"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" -o "$ADEMPIERE_DB_SERVER" = "" -o "$ADEMPIERE_DB_PORT" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ] || [ "$ADEMPIERE_DB_SERVER" = "" ] || [ "$ADEMPIERE_DB_PORT" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -35,7 +35,7 @@ if [ "x$4" = "x" ]
|
|||
then
|
||||
DIR_SCRIPTS=$IDEMPIERE_HOME/migration
|
||||
else
|
||||
if [ `expr substr "$4" 1 1` = "/" ]
|
||||
if [ "${4:0:1}" = "/" ]
|
||||
then
|
||||
DIR_SCRIPTS="$4"
|
||||
else
|
||||
|
@ -43,12 +43,7 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
cd "$DIR_SCRIPTS"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "ERROR: Cannot change to folder $DIR_SCRIPTS"
|
||||
exit 1
|
||||
fi
|
||||
cd "$DIR_SCRIPTS" || (echo "ERROR: Cannot change to folder $DIR_SCRIPTS"; exit 1)
|
||||
|
||||
# Create list of files already applied - registered in AD_MigrationScript table
|
||||
echo "set heading off
|
||||
|
@ -59,12 +54,12 @@ set echo off
|
|||
select name from ad_migrationscript;" | $SILENTCMD | sed -e 's:^ ::' | grep -v '^$' | sort > $TMPFOLDER/lisDB_$$.txt
|
||||
|
||||
# Create list of files in the migration folder
|
||||
> $TMPFOLDER/lisFS_$$.txt
|
||||
find -type d -name $ADEMPIERE_DB_PATH | grep -v "./processes_post_migration/$ADEMPIERE_DB_PATH" | while read FOLDER
|
||||
: > $TMPFOLDER/lisFS_$$.txt
|
||||
find . -type d -name "$ADEMPIERE_DB_PATH" | grep -v "./processes_post_migration/$ADEMPIERE_DB_PATH" | while read -r FOLDER
|
||||
do
|
||||
cd "${FOLDER}"
|
||||
ls *.sql 2>/dev/null >> $TMPFOLDER/lisFS_$$.txt
|
||||
cd "$DIR_SCRIPTS"
|
||||
cd "${FOLDER}" || (echo "ERROR: Cannot change to folder $FOLDER"; exit 1)
|
||||
ls -- *.sql 2>/dev/null >> $TMPFOLDER/lisFS_$$.txt
|
||||
cd "$DIR_SCRIPTS" || (echo "ERROR: Cannot change to folder $DIR_SCRIPTS"; exit 1)
|
||||
done
|
||||
sort -o $TMPFOLDER/lisFS_$$.txt $TMPFOLDER/lisFS_$$.txt
|
||||
sort -o $TMPFOLDER/lisDB_$$.txt $TMPFOLDER/lisDB_$$.txt
|
||||
|
@ -75,14 +70,14 @@ comm -13 $TMPFOLDER/lisDB_$$.txt $TMPFOLDER/lisFS_$$.txt > $TMPFOLDER/lisPENDING
|
|||
if [ -s $TMPFOLDER/lisPENDING_$$.txt ]
|
||||
then
|
||||
mkdir $TMPFOLDER/SyncDB_out_$$
|
||||
for FILE in `cat $TMPFOLDER/lisPENDING_$$.txt`
|
||||
cat $TMPFOLDER/lisPENDING_$$.txt | while read -r FILE
|
||||
do
|
||||
SCRIPT=`find -name "$FILE" | grep "/$ADEMPIERE_DB_PATH/"`
|
||||
OUTFILE=$TMPFOLDER/SyncDB_out_$$/`basename "$FILE" .sql`.out
|
||||
SCRIPT=$(find . -name "$FILE" | grep "/$ADEMPIERE_DB_PATH/")
|
||||
OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out
|
||||
echo "Applying $SCRIPT"
|
||||
cat "$SCRIPT" | $CMD 2>&1 | tee "$OUTFILE"
|
||||
$CMD < "$SCRIPT" 2>&1 | tee "$OUTFILE"
|
||||
APPLIED=Y
|
||||
if egrep "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
|
||||
if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
|
||||
then
|
||||
MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****"
|
||||
# Stop processing to allow user to fix the problem before processing additional files
|
||||
|
@ -99,12 +94,12 @@ else
|
|||
fi
|
||||
if [ x$APPLIED = xY ]
|
||||
then
|
||||
cd "$DIR_POST"
|
||||
for FILE in processes_post_migration/$ADEMPIERE_DB_PATH/*.sql
|
||||
cd "$DIR_POST" || (echo "ERROR: Cannot change to folder $DIR_POST"; exit 1)
|
||||
for FILE in processes_post_migration/"$ADEMPIERE_DB_PATH"/*.sql
|
||||
do
|
||||
OUTFILE=$TMPFOLDER/SyncDB_out_$$/`basename "$FILE" .sql`.out
|
||||
cat "$FILE" | $CMD 2>&1 | tee "$OUTFILE"
|
||||
if egrep "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
|
||||
OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out
|
||||
$CMD 2>&1 < "$FILE" | tee "$OUTFILE"
|
||||
if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
|
||||
then
|
||||
MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****"
|
||||
fi
|
||||
|
@ -113,7 +108,7 @@ fi
|
|||
if [ -n "$MSGERROR" ]
|
||||
then
|
||||
echo "$MSGERROR"
|
||||
echo "\n Errors were found during the process (see message above) - please review and fix the error running manually the script - and then restart this process again"
|
||||
printf "\n Errors were found during the process (see message above) - please review and fix the error running manually the script - and then restart this process again"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo ADempiere PostgreSQL Database Export
|
||||
echo iDempiere PostgreSQL Database Export
|
||||
|
||||
# $Id: DBExport.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $
|
||||
|
||||
echo Saving database $1@$ADEMPIERE_DB_NAME to $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
echo Saving database "$1"@"$ADEMPIERE_DB_NAME" to "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
|
@ -12,7 +12,7 @@ if [ $# -eq 0 ]
|
|||
echo "Example: $0 adempiere adempiere"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" -o "$ADEMPIERE_DB_SERVER" = "" -o "$ADEMPIERE_DB_PORT" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ] || [ "$ADEMPIERE_DB_SERVER" = "" ] || [ "$ADEMPIERE_DB_PORT" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -24,9 +24,9 @@ fi
|
|||
|
||||
PGPASSWORD=$2
|
||||
export PGPASSWORD
|
||||
pg_dump -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT --no-owner -U $1 $ADEMPIERE_DB_NAME > $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
pg_dump -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" --no-owner -U "$1" "$ADEMPIERE_DB_NAME" > "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
PGPASSWORD=
|
||||
export PGPASSWORD
|
||||
|
||||
cd $IDEMPIERE_HOME/data
|
||||
cd "$IDEMPIERE_HOME"/data || exit
|
||||
jar cvfM ExpDat.jar ExpDat.dmp
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo ADempiere Database Import
|
||||
echo iDempiere Database Import
|
||||
|
||||
echo Importing ADempiere DB from $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
echo Importing iDempiere DB from "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
|
||||
if [ $# -le 2 ]
|
||||
then
|
||||
|
@ -10,7 +10,7 @@ if [ $# -le 2 ]
|
|||
echo "Example: $0 postgres adempiere adempiere postgrespwd"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" -o "$ADEMPIERE_DB_SERVER" = "" -o "$ADEMPIERE_DB_PORT" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ] || [ "$ADEMPIERE_DB_SERVER" = "" ] || [ "$ADEMPIERE_DB_PORT" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -60,35 +60,35 @@ then
|
|||
# Assuming that adempiere role already exists (it was created out there)
|
||||
PGPASSWORD=$3
|
||||
export PGPASSWORD
|
||||
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U $2 $ADEMPIERE_DB_NAME
|
||||
dropdb -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U "$2" "$ADEMPIERE_DB_NAME"
|
||||
else
|
||||
if [ "x$2" != xadempiere ]
|
||||
then
|
||||
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres -c "CREATE ROLE adempiere"
|
||||
psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U postgres -c "CREATE ROLE adempiere"
|
||||
fi
|
||||
if [ $ISAMAZONRDS = Y ]
|
||||
then
|
||||
PGPASSWORD=$3
|
||||
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U $2 $ADEMPIERE_DB_NAME
|
||||
dropdb -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U "$2" "$ADEMPIERE_DB_NAME"
|
||||
PGPASSWORD=$4
|
||||
else
|
||||
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $ADEMPIERE_DB_NAME
|
||||
dropdb -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U postgres "$ADEMPIERE_DB_NAME"
|
||||
fi
|
||||
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2
|
||||
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL"
|
||||
dropuser -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U postgres "$2"
|
||||
psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL"
|
||||
fi
|
||||
ADEMPIERE_CREATE_ROLE_SQL=
|
||||
|
||||
PGPASSWORD=$3
|
||||
export PGPASSWORD
|
||||
createdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -E UNICODE -T template0 -O $2 -U $2 $ADEMPIERE_DB_NAME
|
||||
createdb -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -E UNICODE -T template0 -O "$2" -U "$2" "$ADEMPIERE_DB_NAME"
|
||||
|
||||
echo -------------------------------------
|
||||
echo Import Adempiere_pg.dmp
|
||||
echo Import ExpDat.dmp
|
||||
echo -------------------------------------
|
||||
ADEMPIERE_ALTER_ROLE_SQL="ALTER ROLE $2 SET search_path TO adempiere, pg_catalog"
|
||||
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -d $ADEMPIERE_DB_NAME -U $2 -c "$ADEMPIERE_ALTER_ROLE_SQL"
|
||||
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -d $ADEMPIERE_DB_NAME -U $2 -f $IDEMPIERE_HOME/data/ExpDat.dmp
|
||||
psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -d "$ADEMPIERE_DB_NAME" -U "$2" -c "$ADEMPIERE_ALTER_ROLE_SQL"
|
||||
psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -d "$ADEMPIERE_DB_NAME" -U "$2" -f "$IDEMPIERE_HOME"/data/ExpDat.dmp
|
||||
|
||||
PGPASSWORD=
|
||||
export PGPASSWORD
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*************************************************************************
|
||||
* The contents of this file are subject to the Adempiere License. You may
|
||||
* obtain a copy of the License at http://www.adempiere.org/license.html
|
||||
* The contents of this file are subject to the iDempiere License. You may
|
||||
* obtain a copy of the License at http://www.idempiere.org/license.html
|
||||
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
|
||||
* express or implied. See the License for details. Code: Adempiere ERP+CRM
|
||||
* express or implied. See the License for details. Code: iDempiere ERP+CRM
|
||||
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
|
||||
*************************************************************************
|
||||
* $Id: Daily.sql,v 1.1 2006/12/27 globalqss Exp $
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo ADempiere PostgreSQL Database Export
|
||||
echo iDempiere PostgreSQL Database Export
|
||||
|
||||
# $Id: DBExport.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $
|
||||
|
||||
echo Saving database reference@$ADEMPIERE_DB_NAME to $IDEMPIERE_HOME/data/Adempiere_pg.dmp
|
||||
echo Saving database reference@"$ADEMPIERE_DB_NAME" to "$IDEMPIERE_HOME"/data/Adempiere_pg.dmp
|
||||
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" -o "$ADEMPIERE_DB_SERVER" = "" -o "$ADEMPIERE_DB_PORT" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ] || [ "$ADEMPIERE_DB_SERVER" = "" ] || [ "$ADEMPIERE_DB_PORT" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -18,9 +18,9 @@ fi
|
|||
|
||||
PGPASSWORD=reference
|
||||
export PGPASSWORD
|
||||
pg_dump -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT --no-owner -U reference $ADEMPIERE_DB_NAME > $IDEMPIERE_HOME/data/Adempiere_pg.dmp
|
||||
pg_dump -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" --no-owner -U reference "$ADEMPIERE_DB_NAME" > "$IDEMPIERE_HOME"/data/Adempiere_pg.dmp
|
||||
PGPASSWORD=
|
||||
export PGPASSWORD
|
||||
|
||||
cd $IDEMPIERE_HOME/data
|
||||
cd "$IDEMPIERE_HOME"/data || exit
|
||||
jar cvfM Adempiere_pg.jar Adempiere_pg.dmp
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: ImportAdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $
|
||||
echo idempiere Database Import $Revision: 1.10 $
|
||||
# $Id: ImportIdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $
|
||||
echo idempiere Database Import "$Revision": 1.10 $
|
||||
|
||||
echo Importing idempiere DB from $IDEMPIERE_HOME/data/seed/Adempiere$5.dmp
|
||||
echo Importing idempiere DB from "$IDEMPIERE_HOME"/data/seed/Adempiere"$5".dmp
|
||||
|
||||
if [ $# -le 2 ]
|
||||
then
|
||||
|
@ -11,7 +11,7 @@ if [ $# -le 2 ]
|
|||
echo "Example: $0 postgres idempiere idempiere postgresPwd"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" -o "$ADEMPIERE_DB_SERVER" = "" -o "$ADEMPIERE_DB_PORT" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ] || [ "$ADEMPIERE_DB_SERVER" = "" ] || [ "$ADEMPIERE_DB_PORT" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -51,35 +51,35 @@ then
|
|||
# Assuming that adempiere role already exists (it was created out there)
|
||||
PGPASSWORD=$3
|
||||
export PGPASSWORD
|
||||
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U $2 $ADEMPIERE_DB_NAME
|
||||
dropdb -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U "$2" "$ADEMPIERE_DB_NAME"
|
||||
else
|
||||
if [ "x$2" != xadempiere ]
|
||||
then
|
||||
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres -c "CREATE ROLE adempiere"
|
||||
psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U postgres -c "CREATE ROLE adempiere"
|
||||
fi
|
||||
if [ $ISAMAZONRDS = Y ]
|
||||
then
|
||||
PGPASSWORD=$3
|
||||
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U $2 $ADEMPIERE_DB_NAME
|
||||
dropdb -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U "$2" "$ADEMPIERE_DB_NAME"
|
||||
PGPASSWORD=$4
|
||||
else
|
||||
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $ADEMPIERE_DB_NAME
|
||||
dropdb -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U postgres "$ADEMPIERE_DB_NAME"
|
||||
fi
|
||||
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2
|
||||
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL"
|
||||
dropuser -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U postgres "$2"
|
||||
psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL"
|
||||
fi
|
||||
ADEMPIERE_CREATE_ROLE_SQL=
|
||||
|
||||
PGPASSWORD=$3
|
||||
export PGPASSWORD
|
||||
createdb -T template0 -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -E UNICODE -O $2 -U $2 $ADEMPIERE_DB_NAME
|
||||
createdb -T template0 -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -E UNICODE -O "$2" -U "$2" "$ADEMPIERE_DB_NAME"
|
||||
|
||||
echo -------------------------------------
|
||||
echo Import Adempiere$5.dmp
|
||||
echo Import Adempiere"$5".dmp
|
||||
echo -------------------------------------
|
||||
ADEMPIERE_ALTER_ROLE_SQL="ALTER ROLE $2 SET search_path TO adempiere, pg_catalog"
|
||||
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -d $ADEMPIERE_DB_NAME -U $2 -c "$ADEMPIERE_ALTER_ROLE_SQL"
|
||||
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -d $ADEMPIERE_DB_NAME -U $2 -f $IDEMPIERE_HOME/data/seed/Adempiere$5.dmp
|
||||
psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -d "$ADEMPIERE_DB_NAME" -U "$2" -c "$ADEMPIERE_ALTER_ROLE_SQL"
|
||||
psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -d "$ADEMPIERE_DB_NAME" -U "$2" -f "$IDEMPIERE_HOME"/data/seed/Adempiere"$5".dmp
|
||||
ADEMPIERE_ALTER_ROLE_SQL=
|
||||
PGPASSWORD=
|
||||
export PGPASSWORD
|
||||
|
|
|
@ -92,7 +92,7 @@ apply_script()
|
|||
OUTFILE="$2"
|
||||
FILE="$3"
|
||||
echo "Applying $SCRIPT"
|
||||
cat "$SCRIPT" | $CMD > "$OUTFILE" 2>&1
|
||||
$CMD < "$SCRIPT" > "$OUTFILE" 2>&1
|
||||
APPLIED=Y
|
||||
if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
|
||||
then
|
||||
|
@ -283,7 +283,7 @@ then
|
|||
do
|
||||
OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out
|
||||
echo "Applying $FILE"
|
||||
cat "$FILE" | $CMD > "$OUTFILE" 2>&1
|
||||
$CMD < "$FILE" > "$OUTFILE" 2>&1
|
||||
if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
|
||||
then
|
||||
echo "Found error in $SCRIPT"
|
||||
|
|
|
@ -9,7 +9,7 @@ if [ $# -le 2 ]
|
|||
echo "Example: $0 postgres idempiere idempiere postgresPwd"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" -o "$ADEMPIERE_DB_SERVER" = "" -o "$ADEMPIERE_DB_PORT" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ] || [ "$ADEMPIERE_DB_SERVER" = "" ] || [ "$ADEMPIERE_DB_PORT" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -24,6 +24,6 @@ export PGPASSWORD
|
|||
echo -------------------------------------
|
||||
echo Add missing translations
|
||||
echo -------------------------------------
|
||||
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -d $ADEMPIERE_DB_NAME -U $2 -f $IDEMPIERE_HOME/migration/processes_post_migration/$ADEMPIERE_DB_PATH/01_add_missing_translations.sql
|
||||
psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -d "$ADEMPIERE_DB_NAME" -U "$2" -f "$IDEMPIERE_HOME"/migration/processes_post_migration/"$ADEMPIERE_DB_PATH"/01_add_missing_translations.sql
|
||||
PGPASSWORD=
|
||||
export PGPASSWORD
|
||||
|
|
|
@ -7,4 +7,4 @@ echo Start PostgreSQL DB Service
|
|||
# IPC demon may be required for cygwin
|
||||
# ipc-daemon&
|
||||
|
||||
pg_ctl -o "-i" -l $PGLOG start
|
||||
pg_ctl -o "-i" -l "$PGLOG" start
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
echo Synchronize iDempiere Database
|
||||
|
||||
echo Upgrading database $1@$ADEMPIERE_DB_NAME
|
||||
echo Upgrading database "$1@$ADEMPIERE_DB_NAME"
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
|
@ -13,7 +13,7 @@ if [ $# -eq 0 ]
|
|||
echo "Example: $0 adempiere adempiere"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" -o "$ADEMPIERE_DB_SERVER" = "" -o "$ADEMPIERE_DB_PORT" = "" ]
|
||||
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ] || [ "$ADEMPIERE_DB_SERVER" = "" ] || [ "$ADEMPIERE_DB_PORT" = "" ]
|
||||
then
|
||||
echo "Please make sure that the environment variables are set correctly:"
|
||||
echo " IDEMPIERE_HOME e.g. /idempiere"
|
||||
|
@ -37,7 +37,7 @@ if [ "x$4" = "x" ]
|
|||
then
|
||||
DIR_SCRIPTS=$IDEMPIERE_HOME/migration
|
||||
else
|
||||
if [ `expr substr "$4" 1 1` = "/" ]
|
||||
if [ "${4:0:1}" = "/" ]
|
||||
then
|
||||
DIR_SCRIPTS="$4"
|
||||
else
|
||||
|
@ -45,23 +45,18 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
cd "$DIR_SCRIPTS"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "ERROR: Cannot change to folder $DIR_SCRIPTS"
|
||||
exit 1
|
||||
fi
|
||||
cd "$DIR_SCRIPTS" || (echo "ERROR: Cannot change to folder $DIR_SCRIPTS"; exit 1)
|
||||
|
||||
# Create list of files already applied - registered in AD_MigrationScript table
|
||||
echo "select name from ad_migrationscript" | $SILENTCMD | sed -e 's:^ ::' | grep -v '^$' | sort > $TMPFOLDER/lisDB_$$.txt
|
||||
|
||||
# Create list of files in the migration folder
|
||||
> $TMPFOLDER/lisFS_$$.txt
|
||||
find -type d -name $ADEMPIERE_DB_PATH | grep -v "./processes_post_migration/$ADEMPIERE_DB_PATH" | while read FOLDER
|
||||
: > $TMPFOLDER/lisFS_$$.txt
|
||||
find . -type d -name "$ADEMPIERE_DB_PATH" | grep -v "./processes_post_migration/$ADEMPIERE_DB_PATH" | while read -r FOLDER
|
||||
do
|
||||
cd "${FOLDER}"
|
||||
ls *.sql 2>/dev/null >> $TMPFOLDER/lisFS_$$.txt
|
||||
cd "$DIR_SCRIPTS"
|
||||
cd "${FOLDER}" || (echo "ERROR: Cannot change to folder $FOLDER"; exit 1)
|
||||
ls -- *.sql 2>/dev/null >> $TMPFOLDER/lisFS_$$.txt
|
||||
cd "$DIR_SCRIPTS" || (echo "ERROR: Cannot change to folder $DIR_SCRIPTS"; exit 1)
|
||||
done
|
||||
sort -o $TMPFOLDER/lisFS_$$.txt $TMPFOLDER/lisFS_$$.txt
|
||||
sort -o $TMPFOLDER/lisDB_$$.txt $TMPFOLDER/lisDB_$$.txt
|
||||
|
@ -72,14 +67,14 @@ comm -13 $TMPFOLDER/lisDB_$$.txt $TMPFOLDER/lisFS_$$.txt > $TMPFOLDER/lisPENDING
|
|||
if [ -s $TMPFOLDER/lisPENDING_$$.txt ]
|
||||
then
|
||||
mkdir $TMPFOLDER/SyncDB_out_$$
|
||||
for FILE in `cat $TMPFOLDER/lisPENDING_$$.txt`
|
||||
cat $TMPFOLDER/lisPENDING_$$.txt | while read -r FILE
|
||||
do
|
||||
SCRIPT=`find -name "$FILE" | grep "/$ADEMPIERE_DB_PATH/"`
|
||||
OUTFILE=$TMPFOLDER/SyncDB_out_$$/`basename "$FILE" .sql`.out
|
||||
SCRIPT=$(find . -name "$FILE" | grep "/$ADEMPIERE_DB_PATH/")
|
||||
OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out
|
||||
echo "Applying $SCRIPT"
|
||||
cat "$SCRIPT" | $CMD 2>&1 | tee "$OUTFILE"
|
||||
$CMD < "$SCRIPT" 2>&1 | tee "$OUTFILE"
|
||||
APPLIED=Y
|
||||
if egrep "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
|
||||
if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
|
||||
then
|
||||
MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****"
|
||||
# Stop processing to allow user to fix the problem before processing additional files
|
||||
|
@ -96,12 +91,12 @@ else
|
|||
fi
|
||||
if [ x$APPLIED = xY ]
|
||||
then
|
||||
cd "$DIR_POST"
|
||||
for FILE in processes_post_migration/$ADEMPIERE_DB_PATH/*.sql
|
||||
cd "$DIR_POST" || (echo "ERROR: Cannot change to folder $DIR_POST"; exit 1)
|
||||
for FILE in processes_post_migration/"$ADEMPIERE_DB_PATH"/*.sql
|
||||
do
|
||||
OUTFILE=$TMPFOLDER/SyncDB_out_$$/`basename "$FILE" .sql`.out
|
||||
cat "$FILE" | $CMD 2>&1 | tee "$OUTFILE"
|
||||
if egrep "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
|
||||
OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out
|
||||
$CMD 2>&1 < "$FILE" | tee "$OUTFILE"
|
||||
if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
|
||||
then
|
||||
MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****"
|
||||
fi
|
||||
|
@ -112,7 +107,7 @@ export PGPASSWORD
|
|||
if [ -n "$MSGERROR" ]
|
||||
then
|
||||
echo "$MSGERROR"
|
||||
echo "\n Errors were found during the process (see message above) - please review and fix the error running manually the script - and then restart this process again"
|
||||
printf "\n Errors were found during the process (see message above) - please review and fix the error running manually the script - and then restart this process again"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
|
|
|
@ -3,7 +3,7 @@ Version: 7.1
|
|||
Section: web
|
||||
Priority: extra
|
||||
Architecture: all
|
||||
Pre-Depends: openjdk-11-jdk|openjdk-12-jdk|openjdk-13-jdk, postgresql-12|postgresql-11|postgresql-10|postgresql-contrib-9.6, adduser
|
||||
Pre-Depends: openjdk-11-jdk-headless|openjdk-12-jdk-headless|openjdk-13-jdk-headless|openjdk-14-jdk-headless, postgresql-12|postgresql-11|postgresql-10|postgresql-contrib-9.6, adduser
|
||||
Suggests: firefox
|
||||
Installed-Size: 968668
|
||||
Maintainer: Carlos Ruiz <carg67@gmail.com>
|
||||
|
|
|
@ -40,13 +40,13 @@ esac
|
|||
IDEMPIERE_USER=idempiere
|
||||
IDEMPIERE_HOME=/opt/idempiere-server
|
||||
# in case you manual install java by use zip or your linux distros, or your java provider have difference pattern of path, please update here
|
||||
JAVA_HOME=`ls -r /usr/lib/jvm/java-1[12]-openjdk*/bin/javac | head -1`
|
||||
JAVA_HOME=`dirname $JAVA_HOME`
|
||||
JAVA_HOME=$(ls -r /usr/lib/jvm/java-1[1234]-openjdk*/bin/javac | head -1)
|
||||
JAVA_HOME=$(dirname "$JAVA_HOME")
|
||||
SU=su
|
||||
export IDEMPIERE_HOME
|
||||
export TELNET_PORT=12612
|
||||
|
||||
if [ $(id -u) != "0" ]
|
||||
if [ "$(id -u)" != "0" ]
|
||||
then
|
||||
echo "You must be root to run the configure script. Login as root and then run the configure script."
|
||||
exit 1
|
||||
|
@ -56,7 +56,7 @@ RETVAL=0
|
|||
IDEMPIERESTATUS=
|
||||
MAXSECONDS=120 # max wait 2 minutes
|
||||
SLEEPSECONDS=2
|
||||
MAXITERATIONS=`expr $MAXSECONDS / $SLEEPSECONDS`
|
||||
MAXITERATIONS=$((MAXSECONDS / SLEEPSECONDS))
|
||||
|
||||
CONFIG_NAME=idempiere
|
||||
CONFIGURATION="/etc/sysconfig/$CONFIG_NAME"
|
||||
|
@ -184,7 +184,6 @@ RUN_AT_STARTUP=${RUN_AT_STARTUP:-false}
|
|||
CONFIGURE_RUN=${CONFIGURE_RUN}
|
||||
|
||||
EOF
|
||||
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
return 1
|
||||
|
@ -245,7 +244,7 @@ configure_perform()
|
|||
!
|
||||
echo "Done"
|
||||
fi
|
||||
grep ${ADEMPIERE_WEB_PORT} ${IDEMPIERE_HOME}/jettyhome/etc/jetty-selector.xml > /dev/null 2>&1
|
||||
grep "${ADEMPIERE_WEB_PORT}" ${IDEMPIERE_HOME}/jettyhome/etc/jetty-selector.xml > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Error deploying iDempiere, please verify and try again"
|
||||
|
@ -288,7 +287,7 @@ configure_perform()
|
|||
|
||||
checkportused()
|
||||
{
|
||||
port=`netstat -n --tcp --listen | grep :$1 | awk '{print $4}' | cut -d':' -f2`
|
||||
port=$(netstat -n --tcp --listen | grep :"$1" | awk '{print $4}' | cut -d':' -f2)
|
||||
if [ "$port" = "$1" ]
|
||||
then
|
||||
return 0 # Used
|
||||
|
@ -322,18 +321,18 @@ EOF
|
|||
#get the http port value
|
||||
while :
|
||||
do
|
||||
while [ 1 ]
|
||||
while :
|
||||
do
|
||||
echo -n Specify the HTTP port that will be used for iDempiere server [8080]:
|
||||
read LINE
|
||||
if [ -z $LINE ]
|
||||
echo -n "Specify the HTTP port that will be used for iDempiere server [8080]:"
|
||||
read -r LINE
|
||||
if [ -z "$LINE" ]
|
||||
then
|
||||
LINE=8080
|
||||
fi
|
||||
if checkportused "$LINE"
|
||||
then
|
||||
echo Port $port appears to be in use by another application.\
|
||||
Please specify a different port.
|
||||
echo "Port $port appears to be in use by another application.
|
||||
Please specify a different port."
|
||||
else
|
||||
break;
|
||||
fi
|
||||
|
@ -356,18 +355,18 @@ EOF
|
|||
#get the https port value
|
||||
while :
|
||||
do
|
||||
while [ 1 ]
|
||||
while :
|
||||
do
|
||||
echo -n Specify the HTTPS port that will be used for iDempiere server [8443]:
|
||||
read LINE
|
||||
if [ -z $LINE ]
|
||||
echo -n "Specify the HTTPS port that will be used for iDempiere server [8443]:"
|
||||
read -r LINE
|
||||
if [ -z "$LINE" ]
|
||||
then
|
||||
LINE=8443
|
||||
fi
|
||||
if checkportused "$LINE"
|
||||
then
|
||||
echo Port $port appears to be in use by another application.\
|
||||
Please specify a different port.
|
||||
echo "Port $port appears to be in use by another application.
|
||||
Please specify a different port."
|
||||
else
|
||||
break;
|
||||
fi
|
||||
|
@ -391,23 +390,23 @@ EOF
|
|||
while :
|
||||
do
|
||||
echo -n "Specify a password to be used for adempiere database account:"
|
||||
while [ 1 ]
|
||||
while :
|
||||
do
|
||||
stty -echo > /dev/null 2>&1
|
||||
temp=`echo $IFS`
|
||||
temp=$(echo "$IFS")
|
||||
export IFS="\n"
|
||||
while [ 1 ]
|
||||
while :
|
||||
do
|
||||
read LINE
|
||||
read -r LINE
|
||||
while [ -z "$LINE" ]
|
||||
do
|
||||
echo
|
||||
echo -n "Password can't be null. Enter password:"
|
||||
read LINE
|
||||
read -r LINE
|
||||
done
|
||||
|
||||
result=`expr index "$LINE" [\'\"]`
|
||||
if [ $result != 0 ];
|
||||
result=$(expr index "$LINE" [\'\"])
|
||||
if [ "$result" != 0 ];
|
||||
then
|
||||
echo
|
||||
echo -n "The password you entered contains invalid characters. Enter password:"
|
||||
|
@ -417,7 +416,7 @@ EOF
|
|||
done
|
||||
echo
|
||||
echo -n "Confirm the password:"
|
||||
read LINE1
|
||||
read -r LINE1
|
||||
echo
|
||||
if [ "$LINE" != "$LINE1" ];
|
||||
then
|
||||
|
@ -438,21 +437,21 @@ EOF
|
|||
do
|
||||
echo -n "Specify the password of the user postgres on postgres database
|
||||
(if empty then local connection will be tried):"
|
||||
while [ 1 ]
|
||||
while :
|
||||
do
|
||||
stty -echo > /dev/null 2>&1
|
||||
temp=`echo $IFS`
|
||||
export IFS="\n"
|
||||
while [ 1 ]
|
||||
while :
|
||||
do
|
||||
read LINE
|
||||
read -r LINE
|
||||
if [ -z "$LINE" ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
|
||||
result=`expr index "$LINE" [\'\"]`
|
||||
if [ $result != 0 ];
|
||||
result=$(expr index "$LINE" [\'\"])
|
||||
if [ "$result" != 0 ];
|
||||
then
|
||||
echo
|
||||
echo -n "The password you entered contains invalid characters. Enter password:"
|
||||
|
@ -500,16 +499,10 @@ Enter postgres password:"
|
|||
|
||||
while :
|
||||
do
|
||||
if [ "${RUN_AT_STARTUP}" = "true" ]
|
||||
then
|
||||
CUR=y
|
||||
else
|
||||
CUR=n
|
||||
fi
|
||||
echo
|
||||
echo -n "Do you want iDempiere ERP Server to be started on boot (y/n) [y]:"
|
||||
read LINE
|
||||
if [ -z $LINE ]
|
||||
read -r LINE
|
||||
if [ -z "$LINE" ]
|
||||
then
|
||||
RUN_AT_STARTUP=true
|
||||
fi
|
||||
|
@ -535,7 +528,7 @@ Enter postgres password:"
|
|||
|
||||
getidempierestatus() {
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME}
|
||||
echo "$IDEMPIERESTATUSSTRING" | grep -q ${IDEMPIERE_HOME}
|
||||
IDEMPIERESTATUS=$?
|
||||
}
|
||||
|
||||
|
@ -550,8 +543,8 @@ configure()
|
|||
configure_perform
|
||||
CONFIGURE_RUN=true
|
||||
write_sysconfig
|
||||
echo To access the iDempiere Server Home Page, start the server with 'systemctl start idempiere'
|
||||
echo and then go to \"http://127.0.0.1:${ADEMPIERE_WEB_PORT}\"
|
||||
echo "To access the iDempiere Server Home Page, start the server with 'systemctl start idempiere'"
|
||||
echo "and then go to \"http://127.0.0.1:${ADEMPIERE_WEB_PORT}\""
|
||||
|
||||
}
|
||||
|
||||
|
@ -570,7 +563,7 @@ start () {
|
|||
return 1
|
||||
fi
|
||||
echo -n "Starting iDempiere ERP: "
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_`date +%Y%m%d%H%M%S`.log
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_$(date +%Y%m%d%H%M%S).log
|
||||
$SU ${IDEMPIERE_USER} -c "mkdir -p $IDEMPIERE_HOME/log"
|
||||
$SU ${IDEMPIERE_USER} -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
|
||||
RETVAL=$?
|
||||
|
@ -580,9 +573,9 @@ start () {
|
|||
ITERATIONS=0
|
||||
while [ $STATUSTEST -eq 0 ] ; do
|
||||
sleep $SLEEPSECONDS
|
||||
cat $LOGFILE | grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' && STATUSTEST=1
|
||||
grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' < "$LOGFILE" && STATUSTEST=1
|
||||
echo -n "."
|
||||
ITERATIONS=`expr $ITERATIONS + 1`
|
||||
ITERATIONS=$((ITERATIONS + 1))
|
||||
if [ $ITERATIONS -gt $MAXITERATIONS ]
|
||||
then
|
||||
break
|
||||
|
@ -618,7 +611,7 @@ stop () {
|
|||
return 1
|
||||
fi
|
||||
echo -n "Stopping iDempiere ERP: "
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
cd $IDEMPIERE_HOME/utils || exit
|
||||
# try shutdown from OSGi console, then direct kill with signal 15, then signal 9
|
||||
log_warning_msg "Trying shutdown from OSGi console"
|
||||
( echo exit; echo y; sleep 5 ) | telnet localhost ${TELNET_PORT} > /dev/null 2>&1
|
||||
|
@ -627,14 +620,14 @@ stop () {
|
|||
log_success_msg "Service stopped with OSGi shutdown"
|
||||
else
|
||||
log_warning_msg "Trying direct kill with signal -15"
|
||||
kill -15 -`ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -15 -$(ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u)
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
log_success_msg "Service stopped with kill -15"
|
||||
else
|
||||
log_warning_msg "Trying direct kill with signal -9"
|
||||
kill -9 -`ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -9 -$(ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u)
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
|
|
|
@ -1,24 +1,25 @@
|
|||
#!/bin/sh
|
||||
TMP=/tmp
|
||||
cd `dirname $0`/../../..
|
||||
IDEMPIERE_HOME=`pwd`
|
||||
cd "$(dirname "$0")"/../../.. || exit
|
||||
IDEMPIERE_HOME=$(pwd)
|
||||
RWD=$IDEMPIERE_HOME/idempiere-server/utils/unix
|
||||
PACKAGE=`ls -d $IDEMPIERE_HOME`
|
||||
PACKAGE=`basename $PACKAGE`
|
||||
PACKAGE=$(ls -d "$IDEMPIERE_HOME")
|
||||
PACKAGE=$(basename "$PACKAGE")
|
||||
# VERSION=dev
|
||||
# TIMESTAMP=`date +%Y%m%d`
|
||||
# TIMESTAMP=$(date +%Y%m%d)
|
||||
# PACKFILE=$IDEMPIERE_HOME/../${PACKAGE}_${VERSION}_${TIMESTAMP}.deb
|
||||
PACKFILE=$IDEMPIERE_HOME/../${PACKAGE}.deb
|
||||
find $RWD/../.. -name "*.sh" -exec chmod +x {} \;
|
||||
chmod +x $RWD/DebianInstaller/etc/init.d/idempiere
|
||||
rm -f $TMP/debian-binary $TMP/control.tar.gz $TMP/data.tar.gz $TMP/control.tar $TMP/data.tar $PACKFILE
|
||||
find "$RWD"/../.. -name "*.sh" -exec chmod +x {} \;
|
||||
chmod +x "$RWD"/DebianInstaller/etc/init.d/idempiere
|
||||
rm -f $TMP/debian-binary $TMP/control.tar.gz $TMP/data.tar.gz $TMP/control.tar $TMP/data.tar "$PACKFILE"
|
||||
echo 2.0 > $TMP/debian-binary
|
||||
tar cvf $TMP/control.tar -C $RWD/DebianInstaller/DEBIAN .
|
||||
tar cvf $TMP/control.tar -C "$RWD"/DebianInstaller/DEBIAN .
|
||||
gzip -v -9 $TMP/control.tar
|
||||
tar cvf $TMP/data.tar -C $RWD/DebianInstaller/ ./usr
|
||||
tar rvf $TMP/data.tar --exclude='idempiere.gtk.linux.x86_64/idempiere-server/utils/unix/createDEBpackage.sh' --exclude='idempiere.gtk.linux.x86_64/idempiere-server/utils/unix/DebianInstaller' --transform 's:^idempiere.gtk.linux.x86_64/idempiere-server:./opt/idempiere-server:' -C $RWD/../../../.. $PACKAGE > /dev/null
|
||||
tar rvf $TMP/data.tar -C $RWD/DebianInstaller/ ./etc
|
||||
tar cvf $TMP/data.tar -C "$RWD"/DebianInstaller/ ./usr
|
||||
tar rvf $TMP/data.tar --exclude='idempiere.gtk.linux.x86_64/idempiere-server/utils/unix/createDEBpackage.sh' --exclude='idempiere.gtk.linux.x86_64/idempiere-server/utils/unix/DebianInstaller' --transform 's:^idempiere.gtk.linux.x86_64/idempiere-server:./opt/idempiere-server:' -C "$RWD"/../../../.. "$PACKAGE" > /dev/null
|
||||
tar rvf $TMP/data.tar -C "$RWD"/DebianInstaller/ ./etc
|
||||
gzip -v -9 $TMP/data.tar
|
||||
cd $TMP
|
||||
ar q $PACKFILE debian-binary control.tar.gz data.tar.gz
|
||||
cd $TMP || exit
|
||||
ar q "$PACKFILE" debian-binary control.tar.gz data.tar.gz
|
||||
rm debian-binary control.tar.gz data.tar.gz
|
||||
echo "Created $PACKFILE"
|
||||
|
|
|
@ -34,7 +34,7 @@ MAXITERATIONS=60
|
|||
|
||||
getidempierestatus() {
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME}
|
||||
echo "$IDEMPIERESTATUSSTRING" | grep -q ${IDEMPIERE_HOME}
|
||||
IDEMPIERESTATUS=$?
|
||||
}
|
||||
|
||||
|
@ -45,9 +45,9 @@ start () {
|
|||
return 1
|
||||
fi
|
||||
echo -n "Starting iDempiere ERP: "
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
cd $IDEMPIERE_HOME/utils || exit
|
||||
. $ENVFILE
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_`date +%Y%m%d%H%M%S`.log
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_$(date +%Y%m%d%H%M%S).log
|
||||
su $IDEMPIEREUSER -c "mkdir -p $IDEMPIERE_HOME/log"
|
||||
su $IDEMPIEREUSER -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
|
||||
RETVAL=$?
|
||||
|
@ -57,10 +57,10 @@ start () {
|
|||
ITERATIONS=0
|
||||
while [ $STATUSTEST -eq 0 ] ; do
|
||||
sleep 2
|
||||
cat $LOGFILE | grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' && STATUSTEST=1
|
||||
grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' < "$LOGFILE" && STATUSTEST=1
|
||||
echo -n "."
|
||||
ITERATIONS=`expr $ITERATIONS + 1`
|
||||
if [ $ITERATIONS -gt $MAXITERATIONS ]
|
||||
ITERATIONS=$((ITERATIONS + 1))
|
||||
if [ "$ITERATIONS" -gt $MAXITERATIONS ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
|
@ -87,7 +87,7 @@ stop () {
|
|||
return 1
|
||||
fi
|
||||
echo -n "Stopping iDempiere ERP: "
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
cd $IDEMPIERE_HOME/utils || exit
|
||||
. $ENVFILE
|
||||
# try shutdown from OSGi console, then direct kill with signal 15, then signal 9
|
||||
log_warning_msg "Trying shutdown from OSGi console"
|
||||
|
@ -97,14 +97,14 @@ stop () {
|
|||
log_success_msg "Service stopped with OSGi shutdown"
|
||||
else
|
||||
log_warning_msg "Trying direct kill with signal -15"
|
||||
kill -15 -`ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -15 -$(ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u)
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
log_success_msg "Service stopped with kill -15"
|
||||
else
|
||||
log_warning_msg "Trying direct kill with signal -9"
|
||||
kill -9 -`ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -9 -$(ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u)
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
|
@ -159,7 +159,7 @@ case "$1" in
|
|||
status
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
|
||||
echo "Usage: $0 {start|stop|restart|condrestart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ MAXITERATIONS=60 # 2 seconds every iteration, max wait 2 minutes
|
|||
|
||||
getidempierestatus() {
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME}
|
||||
echo "$IDEMPIERESTATUSSTRING" | grep -q ${IDEMPIERE_HOME}
|
||||
IDEMPIERESTATUS=$?
|
||||
}
|
||||
|
||||
|
@ -41,9 +41,9 @@ start () {
|
|||
return 1
|
||||
fi
|
||||
echo -n "Starting iDempiere ERP: "
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
cd $IDEMPIERE_HOME/utils || exit
|
||||
source $ENVFILE
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_`date +%Y%m%d%H%M%S`.log
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_$(date +%Y%m%d%H%M%S).log
|
||||
su $IDEMPIEREUSER -c "mkdir -p $IDEMPIERE_HOME/log"
|
||||
su $IDEMPIEREUSER -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
|
||||
RETVAL=$?
|
||||
|
@ -53,9 +53,9 @@ start () {
|
|||
ITERATIONS=0
|
||||
while [ $STATUSTEST -eq 0 ] ; do
|
||||
sleep 2
|
||||
cat $LOGFILE | grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' && STATUSTEST=1
|
||||
grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' < "$LOGFILE" && STATUSTEST=1
|
||||
echo -n "."
|
||||
ITERATIONS=`expr $ITERATIONS + 1`
|
||||
ITERATIONS=$((ITERATIONS + 1))
|
||||
if [ $ITERATIONS -gt $MAXITERATIONS ]
|
||||
then
|
||||
break
|
||||
|
@ -83,7 +83,7 @@ stop () {
|
|||
return 1
|
||||
fi
|
||||
echo -n "Stopping iDempiere ERP: "
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
cd $IDEMPIERE_HOME/utils || exit
|
||||
source $ENVFILE
|
||||
# try shutdown from OSGi console, then direct kill with signal 15, then signal 9
|
||||
echo "Trying shutdown from OSGi console"
|
||||
|
@ -93,14 +93,14 @@ stop () {
|
|||
echo_success
|
||||
else
|
||||
echo "Trying direct kill with signal -15"
|
||||
kill -15 -`ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -15 -$(ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u)
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
echo_success
|
||||
else
|
||||
echo "Trying direct kill with signal -9"
|
||||
kill -9 -`ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -9 -$(ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u)
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
|
|
|
@ -59,7 +59,7 @@ MAXITERATIONS=60
|
|||
|
||||
getidempierestatus() {
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME}
|
||||
echo "$IDEMPIERESTATUSSTRING" | grep -q ${IDEMPIERE_HOME}
|
||||
IDEMPIERESTATUS=$?
|
||||
}
|
||||
|
||||
|
@ -71,9 +71,9 @@ start () {
|
|||
return
|
||||
fi
|
||||
echo -n "Starting iDempiere ERP: "
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
cd $IDEMPIERE_HOME/utils || exit
|
||||
. $ENVFILE
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_`date +%Y%m%d%H%M%S`.log
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_$(date +%Y%m%d%H%M%S).log
|
||||
su $IDEMPIEREUSER -c "mkdir -p $IDEMPIERE_HOME/log"
|
||||
su $IDEMPIEREUSER -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
|
||||
RETVAL=$?
|
||||
|
@ -83,9 +83,9 @@ start () {
|
|||
ITERATIONS=0
|
||||
while [ $STATUSTEST -eq 0 ] ; do
|
||||
sleep 2
|
||||
cat $LOGFILE | grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' && STATUSTEST=1
|
||||
grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' < "$LOGFILE" && STATUSTEST=1
|
||||
echo -n "."
|
||||
ITERATIONS=`expr $ITERATIONS + 1`
|
||||
ITERATIONS=$((ITERATIONS + 1))
|
||||
if [ $ITERATIONS -gt $MAXITERATIONS ]
|
||||
then
|
||||
break
|
||||
|
@ -114,7 +114,7 @@ stop () {
|
|||
return
|
||||
fi
|
||||
echo -n "Stopping iDempiere ERP: "
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
cd $IDEMPIERE_HOME/utils || exit
|
||||
. $ENVFILE
|
||||
# try shutdown from OSGi console, then direct kill with signal 15, then signal 9
|
||||
log_warning_msg "Trying shutdown from OSGi console"
|
||||
|
@ -124,14 +124,14 @@ stop () {
|
|||
echo "Service stopped with OSGi shutdown"
|
||||
else
|
||||
echo "Trying direct kill with signal -15"
|
||||
kill -15 -`ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -15 -$(ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u)
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
echo "Service stopped with kill -15"
|
||||
else
|
||||
echo "Trying direct kill with signal -9"
|
||||
kill -9 -`ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -9 -$(ps ax o pgid,command | grep ${IDEMPIERE_HOME} | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u)
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
|
@ -193,7 +193,7 @@ case "$1" in
|
|||
status
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
|
||||
echo "Usage: $0 {start|stop|restart|condrestart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
|
||||
cd $(dirname "${0}")
|
||||
cd "$(dirname "${0}")" || (echo "Cannot cd"; exit 1)
|
||||
DESTINATION=$(pwd)
|
||||
|
||||
VMOPTS="-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true"
|
||||
java $VMOPTS -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -profile DefaultProfile -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -u $2
|
||||
java $VMOPTS -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -profile DefaultProfile -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -i $2
|
||||
java "$VMOPTS" -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -profile DefaultProfile -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination "$DESTINATION" -repository "$1" -u "$2"
|
||||
java "$VMOPTS" -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -profile DefaultProfile -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination "$DESTINATION" -repository "$1" -i "$2"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
|
||||
cd $(dirname "${0}")
|
||||
cd "$(dirname "${0}")" || (echo "Cannot cd"; exit 1)
|
||||
DESTINATION=$(pwd)
|
||||
|
||||
cp idempiere.ini idempiere.ini.sav
|
||||
|
@ -33,7 +33,7 @@ then
|
|||
cp jettyhome/etc/jetty-selector.xml jetty-selector.xml.sav
|
||||
fi
|
||||
|
||||
$DESTINATION/update-prd.sh $1 org.adempiere.server.product
|
||||
"$DESTINATION"/update-prd.sh "$1" org.adempiere.server.product
|
||||
|
||||
cp idempiere.ini.sav idempiere.ini
|
||||
|
||||
|
|
Loading…
Reference in New Issue