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:
Carlos Ruiz 2020-09-08 19:37:00 +02:00 committed by GitHub
parent e72dfd66c0
commit 970936d08c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 491 additions and 494 deletions

View File

@ -37,7 +37,7 @@ then
Please run first install.app or install.console.app within eclipse" Please run first install.app or install.console.app within eclipse"
exit 1 exit 1
fi fi
cd "$IDEMPIERE_HOME" || exit cd "$IDEMPIERE_HOME" || (echo "Cannot cd to $IDEMPIERE_HOME"; exit 1)
CONN=$(grep "^Connection=.*type" "$PROPFILE") CONN=$(grep "^Connection=.*type" "$PROPFILE")
if [ -z "$CONN" ] if [ -z "$CONN" ]
then then

View File

@ -1,14 +1,12 @@
#!/bin/sh #!/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 $ # $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 JAVA=$JAVA_HOME/bin/java
KEYTOOL=$JAVA_HOME/bin/keytool
else else
JAVA=java JAVA=java
KEYTOOL=keytool
echo JAVA_HOME is not set. echo JAVA_HOME is not set.
echo You may not be able to start the Setup echo You may not be able to start the Setup
echo Set JAVA_HOME to the directory of your local JDK. 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 ===================================
echo Make .sh executable & set Env echo Make .sh executable & set Env
echo =================================== echo ===================================
chmod -R a+x *.sh chmod -R a+x -- *.sh
find . -name '*.sh' -exec chmod a+x '{}' \; find . -name '*.sh' -exec chmod a+x '{}' \;
echo . echo .

View File

@ -1,9 +1,10 @@
#!/bin/sh #!/bin/sh
# #
unset DISPLAY unset DISPLAY
BASE=`dirname $( readlink -f $0 )` BASE=$(dirname "$( readlink -f "$0" )")
. $BASE/utils/myEnvironment.sh Server export ID_ENV=Server
if [ $JAVA_HOME ]; then . "$BASE"/utils/myEnvironment.sh
if [ "$JAVA_HOME" ]; then
JAVA=$JAVA_HOME/bin/java JAVA=$JAVA_HOME/bin/java
else else
JAVA=java JAVA=java
@ -40,4 +41,4 @@ VMOPTS="-Dorg.osgi.framework.bootdelegation=sun.security.ssl,org.w3c.dom.events
--add-modules=ALL-SYSTEM --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" --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

View File

@ -1,14 +1,12 @@
#!/bin/sh #!/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 $ # $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 JAVA=$JAVA_HOME/bin/java
KEYTOOL=$JAVA_HOME/bin/keytool
else else
JAVA=java JAVA=java
KEYTOOL=keytool
echo JAVA_HOME is not set. echo JAVA_HOME is not set.
echo You may not be able to start the Setup echo You may not be able to start the Setup
echo Set JAVA_HOME to the directory of your local JDK. 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 $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 echo ... Make .sh executable
chmod -R a+x *.sh chmod -R a+x -- *.sh
find . -name '*.sh' -exec chmod a+x '{}' \; find . -name '*.sh' -exec chmod a+x '{}' \;
echo ... echo ...

View File

@ -10,7 +10,7 @@ echo ... Setup Jetty
./idempiere --launcher.ini setup.ini -application org.eclipse.ant.core.antRunner -buildfile build.xml ./idempiere --launcher.ini setup.ini -application org.eclipse.ant.core.antRunner -buildfile build.xml
echo ... Make .sh executable echo ... Make .sh executable
chmod -R a+x *.sh chmod -R a+x -- *.sh
find . -name '*.sh' -exec chmod a+x '{}' \; find . -name '*.sh' -exec chmod a+x '{}' \;
echo ... echo ...

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
if [ $JAVA_HOME ]; then if [ "$JAVA_HOME" ]; then
JAVA=$JAVA_HOME/bin/java JAVA=$JAVA_HOME/bin/java
else else
JAVA=java JAVA=java

View File

@ -1,20 +1,21 @@
#!/bin/sh #!/bin/sh
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
else else
cd "`dirname $0`" cd "$(dirname "$0")" || (echo "Cannot cd "; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
. ./myEnvironment.sh
if [ $JAVA_HOME ]; then if [ "$JAVA_HOME" ]; then
JAVA=$JAVA_HOME/bin/java JAVA=$JAVA_HOME/bin/java
else else
JAVA=java JAVA=java
fi fi
# $Id: RUN_ApplyPackInFromFolder.sh # $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 ] if [ $# -eq 1 ]
then then
@ -24,11 +25,11 @@ else
exit 1 exit 1
fi 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 Done
echo . echo .

View File

@ -2,20 +2,21 @@
# Author + Copyright 1999-2005 Jorg Janke # Author + Copyright 1999-2005 Jorg Janke
# $Id: RUN_DBExport.sh,v 1.10 2005/05/31 18:45:33 jjanke Exp $ # $Id: RUN_DBExport.sh,v 1.10 2005/05/31 18:45:33 jjanke Exp $
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Export idempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./myEnvironment.sh
echo Export idempiere Database - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
# Parameter: <adempiereDBuser>/<adempiereDBpassword> # 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 # sh $ADEMPIERE_DB_PATH/DBExportFull.sh system/$ADEMPIERE_DB_SYSTEM
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
sh myDBcopy.sh sh myDBcopy.sh

View File

@ -2,20 +2,21 @@
# Author + Copyright 1999-2005 Jorg Janke # Author + Copyright 1999-2005 Jorg Janke
# $Id: RUN_DBExport.sh,v 1.10 2005/05/31 18:45:33 jjanke Exp $ # $Id: RUN_DBExport.sh,v 1.10 2005/05/31 18:45:33 jjanke Exp $
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Export idempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./myEnvironment.sh
echo Export idempiere Database - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
# Parameter: <adempiereDBuser>/<adempiereDBpassword> # 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 # sh $ADEMPIERE_DB_PATH/DBExportFulldp.sh system/$ADEMPIERE_DB_SYSTEM
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
sh myDBcopy.sh sh myDBcopy.sh

View File

@ -1,19 +1,20 @@
#!/bin/sh #!/bin/sh
# $Id: RUN_DBRestore.sh,v 1.9 2005/01/22 21:59:15 jjanke Exp $ # $Id: RUN_DBRestore.sh,v 1.9 2005/01/22 21:59:15 jjanke Exp $
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Restore idempiere Database from Export- $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./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 Re-Create idempiere User and import "$IDEMPIERE_HOME"/data/ExpDat.dmp
echo == The import will show warnings. This is OK == echo "== The import will show warnings. This is OK =="
ls -lsa $IDEMPIERE_HOME/data/ExpDat.dmp ls -lsa "$IDEMPIERE_HOME"/data/ExpDat.dmp
echo Press enter to continue ... echo Press enter to continue ...
read in read -r _
# Parameter: <systemAccount> <adempiereID> <adempierePwd> # Parameter: <systemAccount> <adempiereID> <adempierePwd>
# globalqss - cruiz - 2007-10-09 - added fourth parameter for postgres(ignored in oracle) # 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"

View File

@ -1,19 +1,20 @@
#!/bin/sh #!/bin/sh
# $Id: RUN_DBRestore.sh,v 1.9 2005/01/22 21:59:15 jjanke Exp $ # $Id: RUN_DBRestore.sh,v 1.9 2005/01/22 21:59:15 jjanke Exp $
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Restore idempiere Database from Export- $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./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 Re-Create idempiere User and import "$IDEMPIERE_HOME"/data/ExpDat.dmp
echo == The import will show warnings. This is OK == echo "== The import will show warnings. This is OK =="
ls -lsa $IDEMPIERE_HOME/data/ExpDat.dmp ls -lsa "$IDEMPIERE_HOME"/data/ExpDat.dmp
echo Press enter to continue ... echo Press enter to continue ...
read in read -r _
# Parameter: <systemAccount> <adempiereID> <adempierePwd> # Parameter: <systemAccount> <adempiereID> <adempierePwd>
# globalqss - cruiz - 2007-10-09 - added fourth parameter for postgres(ignored in oracle) # 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"

View File

@ -1,12 +1,13 @@
#!/bin/sh #!/bin/sh
# $Id: RUN_DBStart.sh,v 1.4 2005/01/22 21:59:15 jjanke Exp $ # $Id: RUN_DBStart.sh,v 1.4 2005/01/22 21:59:15 jjanke Exp $
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Start DataBase Service - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./myEnvironment.sh
echo Start DataBase Service - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
sh $ADEMPIERE_DB_PATH/Start.sh sh "$ADEMPIERE_DB_PATH"/Start.sh

View File

@ -1,12 +1,13 @@
#!/bin/sh #!/bin/sh
# $Id: RUN_DBStop.sh,v 1.4 2005/01/22 21:59:15 jjanke Exp $ # $Id: RUN_DBStop.sh,v 1.4 2005/01/22 21:59:15 jjanke Exp $
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Stop DataBase Service - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./myEnvironment.sh
echo Stop DataBase Service - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
sh $ADEMPIERE_DB_PATH/Stop.sh sh "$ADEMPIERE_DB_PATH"/Stop.sh

View File

@ -3,54 +3,54 @@
# $Id: RUN_Env.sh,v 1.16 2005/01/22 21:59:15 jjanke Exp $ # $Id: RUN_Env.sh,v 1.16 2005/01/22 21:59:15 jjanke Exp $
echo idempiere Environment Check echo idempiere Environment Check
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
# Environment is read from the following script myEnvironment.sh # Environment is read from the following script myEnvironment.sh
. ./myEnvironment.sh . ./myEnvironment.sh
echo General ... echo General ...
echo PATH = $PATH echo PATH = "$PATH"
echo CLASSPTH = $CLASSPATH echo CLASSPTH = "$CLASSPATH"
echo . echo .
echo Homes ... echo Homes ...
echo IDEMPIERE_HOME = $IDEMPIERE_HOME echo IDEMPIERE_HOME = "$IDEMPIERE_HOME"
echo JAVA_HOME = $JAVA_HOME echo JAVA_HOME = "$JAVA_HOME"
echo ADEMPIERE_DB_URL = $ADEMPIERE_DB_URL echo ADEMPIERE_DB_URL = "$ADEMPIERE_DB_URL"
echo . echo .
echo Database ... echo Database ...
echo ADEMPIERE_DB_USER = $ADEMPIERE_DB_USER echo ADEMPIERE_DB_USER = "$ADEMPIERE_DB_USER"
echo ADEMPIERE_DB_PASSWORD = $ADEMPIERE_DB_PASSWORD echo ADEMPIERE_DB_PASSWORD = "$ADEMPIERE_DB_PASSWORD"
echo ADEMPIERE_DB_PATH = $ADEMPIERE_DB_PATH echo ADEMPIERE_DB_PATH = "$ADEMPIERE_DB_PATH"
echo .. Oracle specifics echo .. Oracle specifics
echo ADEMPIERE_DB_NAME = $ADEMPIERE_DB_NAME echo ADEMPIERE_DB_NAME = "$ADEMPIERE_DB_NAME"
echo ADEMPIERE_DB_SYSTEM = $ADEMPIERE_DB_SYSTEM echo ADEMPIERE_DB_SYSTEM = "$ADEMPIERE_DB_SYSTEM"
echo . echo .
echo Java Test ... should be 1.6+ echo Java Test ... should be 1.6+
$JAVA_HOME/bin/java -version "$JAVA_HOME"/bin/java -version
echo . echo .
echo Database Connection Test \(1\) ... TNS echo Database Connection Test \(1\) ... TNS
echo Running tnsping $ADEMPIERE_DB_NAME echo Running tnsping "$ADEMPIERE_DB_NAME"
tnsping $ADEMPIERE_DB_NAME tnsping "$ADEMPIERE_DB_NAME"
echo . echo .
echo Database Connection Test \(2\)... System echo Database Connection Test \(2\)... System
echo Running sqlplus system/$ADEMPIERE_DB_SYS@$ADEMPIERE_DB_NAME @$ADEMPIERE_DB_PATH/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 sqlplus system/"$ADEMPIERE_DB_SYSTEM"@"$ADEMPIERE_DB_NAME" @"$ADEMPIERE_DB_HOME"/Test.sql
echo . echo .
echo Checking Database Size \(3\) 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 .
echo == It is ok for the next to fail before the Adempiere Database Import Step == echo "== It is ok for the next to fail before the iDempiere Database Import Step =="
echo Database Connection Test \(4\) ... Adempiere \(May not work, if not user not yet imported\) 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 sqlplus "$ADEMPIERE_DB_USER"/"$ADEMPIERE_DB_PASSWORD"@"$ADEMPIERE_DB_NAME" @"$ADEMPIERE_DB_HOME"/Test.sql
echo . echo .
echo Done echo Done

View File

@ -2,12 +2,13 @@
# Author + Copyright 1999-2005 Jorg Janke # Author + Copyright 1999-2005 Jorg Janke
# $Id: RUN_DBExport.sh,v 1.10 2005/05/31 18:45:33 jjanke Exp $ # $Id: RUN_DBExport.sh,v 1.10 2005/05/31 18:45:33 jjanke Exp $
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Export idempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./myEnvironment.sh
echo Export idempiere Database - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
# Parameter: <adempiereDBuser>/<adempiereDBpassword> # 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"

View File

@ -2,29 +2,30 @@
# #
# $Id: RUN_ImportIdempiere.sh,v 1.9 2005/01/22 21:59:15 jjanke Exp $ # $Id: RUN_ImportIdempiere.sh,v 1.9 2005/01/22 21:59:15 jjanke Exp $
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Import idempiere - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./myEnvironment.sh
echo Import idempiere - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
SUFFIX="" SUFFIX=""
SYSUSER=system SYSUSER=system
if [ $ADEMPIERE_DB_PATH = "postgresql" ] if [ "$ADEMPIERE_DB_PATH" = "postgresql" ]
then then
SUFFIX="_pg" SUFFIX="_pg"
SYSUSER=postgres SYSUSER=postgres
fi fi
echo Re-Create idempiere User and import $IDEMPIERE_HOME/data/Adempiere${SUFFIX}.dmp - \($ADEMPIERE_DB_NAME\) 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 == echo "== The import will show warnings. This is OK =="
cd $IDEMPIERE_HOME/data/seed cd "$IDEMPIERE_HOME"/data/seed || exit
jar xvf Adempiere${SUFFIX}.jar jar xvf Adempiere${SUFFIX}.jar
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || exit
ls -lsa $IDEMPIERE_HOME/data/seed/Adempiere${SUFFIX}.dmp ls -lsa "$IDEMPIERE_HOME"/data/seed/Adempiere${SUFFIX}.dmp
echo Press enter to continue ... echo Press enter to continue ...
read in read -r _
# Parameter: <systemAccount> <AdempiereID> <AdempierePwd> # Parameter: <systemAccount> <AdempiereID> <AdempierePwd>
# globalqss - cruiz - 2007-10-09 - added fourth parameter for postgres(ignored in oracle) # 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"

View File

@ -2,25 +2,26 @@
# #
# $Id: RUN_ImportReference.sh,v 1.11 2005/12/13 00:17:54 jjanke Exp $ # $Id: RUN_ImportReference.sh,v 1.11 2005/12/13 00:17:54 jjanke Exp $
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Import Reference - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./myEnvironment.sh
echo Import Reference - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
SUFFIX="" SUFFIX=""
SYSUSER=system SYSUSER=system
if [ $ADEMPIERE_DB_PATH = "postgresql" ] if [ "$ADEMPIERE_DB_PATH" = "postgresql" ]
then then
SUFFIX="_pg" SUFFIX="_pg"
SYSUSER=postgres SYSUSER=postgres
fi fi
echo Re-Create Reference User and import $IDEMPIERE_HOME/data/Adempiere.dmp - \($ADEMPIERE_DB_NAME\) echo Re-Create Reference User and import "$IDEMPIERE_HOME"/data/Adempiere.dmp - \("$ADEMPIERE_DB_NAME"\)
echo == The import will show warnings. This is OK == echo "== The import will show warnings. This is OK =="
ls -lsa $IDEMPIERE_HOME/data/Adempiere${SUFFIX}.dmp ls -lsa "$IDEMPIERE_HOME"/data/Adempiere${SUFFIX}.dmp
echo Press enter to continue ... echo Press enter to continue ...
read in read -r _
# Parameter: <systemAccount> <AdempiereID> <AdempierePwd> # 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"

View File

@ -1,10 +1,11 @@
#!/bin/bash #!/bin/bash
# Author Carlos Ruiz # Author Carlos Ruiz
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Synchronize iDempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./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" $*

View File

@ -2,13 +2,14 @@
# #
# $Id: RUN_PostMigration.sh # $Id: RUN_PostMigration.sh
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
. ./myEnvironment.sh
#check java home #check java home
if [ $JAVA_HOME ]; then if [ "$JAVA_HOME" ]; then
export PATH=$JAVA_HOME/bin:$PATH export PATH=$JAVA_HOME/bin:$PATH
else else
echo JAVA_HOME is not set. echo JAVA_HOME is not set.
@ -17,7 +18,7 @@ else
exit exit
fi 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 ./idempiere --launcher.ini setup.ini -application org.adempiere.base.PostMigration -consoleLog

View File

@ -1,10 +1,11 @@
#!/bin/sh #!/bin/sh
# Author Carlos Ruiz # Author Carlos Ruiz
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot change to $IDEMPIERE_HOME/utils"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
echo Synchronize iDempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) . ./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" $*

View File

@ -1,20 +1,21 @@
#!/bin/sh #!/bin/sh
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
else else
cd "`dirname $0`" cd "$(dirname "$0")" || (echo "Cannot cd"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
. ./myEnvironment.sh
if [ $JAVA_HOME ]; then if [ "$JAVA_HOME" ]; then
JAVA=$JAVA_HOME/bin/java JAVA=$JAVA_HOME/bin/java
else else
JAVA=java JAVA=java
fi fi
# RUN_SyncTerm.sh # RUN_SyncTerm.sh
echo Synchronize idempiere Terminology - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\) echo Synchronize idempiere Terminology - "$IDEMPIERE_HOME" \("$ADEMPIERE_DB_NAME"\)
cd .. cd ..

View File

@ -1,20 +1,21 @@
#!/bin/sh #!/bin/sh
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
else else
cd "`dirname $0`" cd "$(dirname "$0")" || (echo "Cannot cd"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
. ./myEnvironment.sh
if [ $JAVA_HOME ]; then if [ "$JAVA_HOME" ]; then
JAVA=$JAVA_HOME/bin/java JAVA=$JAVA_HOME/bin/java
else else
JAVA=java JAVA=java
fi fi
# $Id: RUN_TrlExport.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $ # $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 ] if [ $# -gt 0 ]
then then
@ -33,9 +34,9 @@ fi
cd .. 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 Done
echo . echo .

View File

@ -1,20 +1,21 @@
#!/bin/sh #!/bin/sh
if [ $IDEMPIERE_HOME ]; then if [ "$IDEMPIERE_HOME" ]; then
cd $IDEMPIERE_HOME/utils cd "$IDEMPIERE_HOME"/utils || (echo "Cannot cd $IDEMPIERE_HOME/utils"; exit 1)
else else
cd "`dirname $0`" cd "$(dirname "$0")" || (echo "Cannot cd"; exit 1)
fi fi
. ./myEnvironment.sh Server export ID_ENV=Server
. ./myEnvironment.sh
if [ $JAVA_HOME ]; then if [ "$JAVA_HOME" ]; then
JAVA=$JAVA_HOME/bin/java JAVA=$JAVA_HOME/bin/java
else else
JAVA=java JAVA=java
fi fi
# $Id: RUN_TrlImport.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $ # $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 ] if [ $# -gt 0 ]
then then
@ -33,9 +34,9 @@ fi
cd .. 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 Done
echo . echo .

View File

@ -3,9 +3,9 @@
echo Set Unix Environment echo Set Unix Environment
# $Id: RUN_UnixEnvTemplate.sh,v 1.3 2004/03/11 05:41:13 jjanke Exp $ # $Id: RUN_UnixEnvTemplate.sh,v 1.3 2004/03/11 05:41:13 jjanke Exp $
echo =================================== echo "==================================="
echo Setup Client Environment echo "Setup Client Environment"
echo =================================== echo "==================================="
JAVA_HOME=@JAVA_HOME@ JAVA_HOME=@JAVA_HOME@
export JAVA_HOME export JAVA_HOME

View File

@ -3,6 +3,6 @@
# Copy Database after backup # Copy Database after backup
# $Id: myDBcopyTemplate.sh,v 1.1 2002/10/07 01:23:32 jjanke Exp $ # $Id: myDBcopyTemplate.sh,v 1.1 2002/10/07 01:23:32 jjanke Exp $
DATE=`date +%Y%m%d_%H%M%S` DATE=$(date +%Y%m%d_%H%M%S)
mv $IDEMPIERE_HOME/data/ExpDat.jar $IDEMPIERE_HOME/data/ExpDat$DATE.jar mv "$IDEMPIERE_HOME"/data/ExpDat.jar "$IDEMPIERE_HOME"/data/ExpDat"$DATE".jar
echo copy $IDEMPIERE_HOME/data/ExpDat$DATE.jar to backup media echo copy "$IDEMPIERE_HOME"/data/ExpDat"$DATE".jar to backup media

View File

@ -67,7 +67,7 @@ export ADEMPIERE_JAVA
IDEMPIERE_JAVA_OPTIONS="@IDEMPIERE_JAVA_OPTIONS@ -DIDEMPIERE_HOME=$IDEMPIERE_HOME" IDEMPIERE_JAVA_OPTIONS="@IDEMPIERE_JAVA_OPTIONS@ -DIDEMPIERE_HOME=$IDEMPIERE_HOME"
export IDEMPIERE_JAVA_OPTIONS export IDEMPIERE_JAVA_OPTIONS
if [ $DOLLAR$# -eq 0 ] if [ "$ID_ENV" != "Server" ]
then then
cp $IDEMPIERE_HOME/utils/myEnvironment.sh $IDEMPIERE_HOME/utils/myEnvironment.sav cp $IDEMPIERE_HOME/utils/myEnvironment.sh $IDEMPIERE_HOME/utils/myEnvironment.sav
fi fi

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/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 $ # $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 ] if [ $# -eq 0 ]
then then
@ -12,7 +12,7 @@ if [ $# -eq 0 ]
echo "Example: $0 adempiere adempiere" echo "Example: $0 adempiere adempiere"
exit 1 exit 1
fi fi
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
then then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -21,10 +21,10 @@ if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
fi fi
# Cleanup # 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 # 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 jar cvfM ExpDat.jar ExpDat.dmp ExpDat.log

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/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 $ # $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 ] if [ $# -eq 0 ]
then then
@ -12,7 +12,7 @@ if [ $# -eq 0 ]
echo "Example: $0 system/manager" echo "Example: $0 system/manager"
exit 1 exit 1
fi fi
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
then then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -20,8 +20,8 @@ if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
exit 1 exit 1
fi 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 jar cvfM ExpDatFull.jar ExpDatFull.dmp ExpDatFull.log

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/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 $ # $Id: DBExportFull.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $
DATE=`date +%Y%m%d_%H%M%S` DATE=$(date +%Y%m%d_%H%M%S)
echo Saving database $1@$ADEMPIERE_DB_NAME to $IDEMPIERE_HOME/data/ExpDatFull_$DATE.dmp echo Saving database "$1"@"$ADEMPIERE_DB_NAME" to "$IDEMPIERE_HOME"/data/ExpDatFull_"$DATE".dmp
if [ $# -eq 0 ] if [ $# -eq 0 ]
then then
@ -13,7 +13,7 @@ if [ $# -eq 0 ]
echo "Example: $0 system/manager" echo "Example: $0 system/manager"
exit 1 exit 1
fi fi
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
then then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -24,12 +24,12 @@ fi
echo ------------------------------------- echo -------------------------------------
echo Re-Create DataPump directory echo Re-Create DataPump directory
echo ------------------------------------- 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
chgrp dba $IDEMPIERE_HOME/data chgrp dba "$IDEMPIERE_HOME"/data
chmod 770 $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 cd "$IDEMPIERE_HOME"/data || exit
jar cvfM ExpDatFull.jar ExpDatFull_$DATE.dmp ExpDatFull_$DATE.log jar cvfM ExpDatFull.jar ExpDatFull_"$DATE".dmp ExpDatFull_"$DATE".log

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/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 $ # $Id: DBExport.sh,v 1.5 2005/12/20 07:12:17 jjanke Exp $
DATE=`date +%Y%m%d_%H%M%S` DATE=$(date +%Y%m%d_%H%M%S)
echo Saving database $1@$ADEMPIERE_DB_NAME to $IDEMPIERE_HOME/data/ExpDat_$DATE.dmp echo Saving database "$1"@"$ADEMPIERE_DB_NAME" to "$IDEMPIERE_HOME"/data/ExpDat_"$DATE".dmp
if [ $# -eq 0 ] if [ $# -eq 0 ]
then then
@ -13,7 +13,7 @@ if [ $# -eq 0 ]
echo "Example: $0 adempiere adempiere" echo "Example: $0 adempiere adempiere"
exit 1 exit 1
fi fi
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
then then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -22,17 +22,17 @@ if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
fi fi
# Cleanup # 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 -------------------------------------
echo Re-Create DataPump directory echo Re-Create DataPump directory
echo ------------------------------------- echo -------------------------------------
sqlplus $3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $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 chgrp dba "$IDEMPIERE_HOME"/data
chmod 770 $IDEMPIERE_HOME/data chmod 770 "$IDEMPIERE_HOME"/data
# Export # 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 cd "$IDEMPIERE_HOME"/data || exit
jar cvfM ExpDat.jar ExpDat_$DATE.dmp ExpDat_$DATE.log jar cvfM ExpDat.jar ExpDat_"$DATE".dmp ExpDat_"$DATE".log

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# $Id: DBRestore.sh,v 1.8 2005/12/20 07:12:17 jjanke Exp $ # $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 ] if [ $# -le 2 ]
then then
@ -11,7 +11,7 @@ if [ $# -le 2 ]
echo "Example: $0 system/manager adempiere adempiere" echo "Example: $0 system/manager adempiere adempiere"
exit 1 exit 1
fi fi
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
then then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -23,15 +23,15 @@ fi
echo ------------------------------------- echo -------------------------------------
echo Re-Create DB user 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 ------------------------------------- echo -------------------------------------
echo Import ExpDat echo Import ExpDat
echo ------------------------------------- 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 -------------------------------------
echo Check System echo Check System
echo Import may show some warnings. This is OK as long as the following does not show errors 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

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# $Id: DBRestore.sh,v 1.8 2005/12/20 07:12:17 jjanke Exp $ # $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 ] if [ $# -le 2 ]
then then
@ -11,7 +11,7 @@ if [ $# -le 2 ]
echo "Example: $0 system/manager adempiere adempiere" echo "Example: $0 system/manager adempiere adempiere"
exit 1 exit 1
fi fi
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
then then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -23,25 +23,25 @@ fi
echo ------------------------------------- echo -------------------------------------
echo Re-Create DB user 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 ------------------------------------- echo -------------------------------------
echo Re-Create DataPump directory echo Re-Create DataPump directory
echo ------------------------------------- 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 # Note the user running this script must be member of dba group: usermod -G dba idempiere
chgrp dba $IDEMPIERE_HOME/data chgrp dba "$IDEMPIERE_HOME"/data
chmod 770 $IDEMPIERE_HOME/data chmod 770 "$IDEMPIERE_HOME"/data
chgrp dba $IDEMPIERE_HOME/data/ExpDat.dmp chgrp dba "$IDEMPIERE_HOME"/data/ExpDat.dmp
chmod 640 $IDEMPIERE_HOME/data/ExpDat.dmp chmod 640 "$IDEMPIERE_HOME"/data/ExpDat.dmp
echo ------------------------------------- echo -------------------------------------
echo Import ExpDat echo Import ExpDat
echo ------------------------------------- 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 -------------------------------------
echo Check System echo Check System
echo Import may show some warnings. This is OK as long as the following does not show errors 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

View File

@ -1,12 +1,12 @@
#!/bin/sh #!/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 $ # $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 then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -17,13 +17,13 @@ fi
echo ------------------------------------- echo -------------------------------------
echo Re-Create DataPump directory echo Re-Create DataPump directory
echo ------------------------------------- echo -------------------------------------
sqlplus $3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $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 chgrp dba "$IDEMPIERE_HOME"/data
chmod 770 $IDEMPIERE_HOME/data chmod 770 "$IDEMPIERE_HOME"/data
if [ "x${1,,}" != "xreference" ] if [ "x${1,,}" != "xreference" ]
then 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; DROP USER REFERENCE CASCADE;
alter session set "_enable_rename_user"=true; alter session set "_enable_rename_user"=true;
alter system enable restricted session; alter system enable restricted session;
@ -32,13 +32,13 @@ alter system disable restricted session;
! !
fi 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 # 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" ] if [ "x${1,,}" != "xreference" ]
then 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 session set "_enable_rename_user"=true;
alter system enable restricted session; alter system enable restricted session;
ALTER USER REFERENCE RENAME TO $1 IDENTIFIED BY "$2"; ALTER USER REFERENCE RENAME TO $1 IDENTIFIED BY "$2";
@ -46,5 +46,5 @@ alter system disable restricted session;
! !
fi fi
cd $IDEMPIERE_HOME/data cd "$IDEMPIERE_HOME"/data || exit
jar cvfM Adempiere.jar Adempiere.dmp Adempiere.log jar cvfM Adempiere.jar Adempiere.dmp Adempiere.log

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# $Id: ImportAdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $ # $Id: ImportIdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $
echo idempiere Database Import $Revision: 1.10 $ 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 ] if [ $# -le 2 ]
then then
@ -11,7 +11,7 @@ if [ $# -le 2 ]
echo "Example: $0 system/manager idempiere idempiere" echo "Example: $0 system/manager idempiere idempiere"
exit 1 exit 1
fi fi
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
then then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -23,30 +23,30 @@ fi
echo ------------------------------------- echo -------------------------------------
echo Re-Create DB user echo Re-Create DB user
echo ------------------------------------- echo -------------------------------------
echo 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 sqlplus "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/CreateUser.sql "$2" "$3"
echo ------------------------------------- echo -------------------------------------
echo Re-Create DataPump directory echo Re-Create DataPump directory
echo ------------------------------------- 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 # Note the user running this script must be member of dba group: usermod -G dba idempiere
chgrp dba $IDEMPIERE_HOME/data chgrp dba "$IDEMPIERE_HOME"/data
chmod 770 $IDEMPIERE_HOME/data chmod 770 "$IDEMPIERE_HOME"/data
chgrp dba $IDEMPIERE_HOME/data/seed chgrp dba "$IDEMPIERE_HOME"/data/seed
chmod 770 $IDEMPIERE_HOME/data/seed chmod 770 "$IDEMPIERE_HOME"/data/seed
chgrp dba $IDEMPIERE_HOME/data/seed/Adempiere.dmp chgrp dba "$IDEMPIERE_HOME"/data/seed/Adempiere.dmp
chmod 640 $IDEMPIERE_HOME/data/seed/Adempiere.dmp chmod 640 "$IDEMPIERE_HOME"/data/seed/Adempiere.dmp
echo ------------------------------------- echo -------------------------------------
echo Import Adempiere.dmp echo Import Adempiere.dmp
echo ------------------------------------- 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" 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 -------------------------------------
echo Check System echo Check System
echo Import may show some warnings. This is OK as long as the following does not show errors echo Import may show some warnings. This is OK as long as the following does not show errors
echo ------------------------------------- echo -------------------------------------
echo 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 sqlplus "$2"/"$3"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" @"$IDEMPIERE_HOME"/utils/"$ADEMPIERE_DB_PATH"/AfterImport.sql

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# $Id: ImportReference.sh,v 1.5 2005/01/22 21:59:15 jjanke Exp $ # $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 ] if [ $# -eq 2 ]
then then
@ -11,7 +11,7 @@ if [ $# -eq 2 ]
echo "Example: $0 system/manager" echo "Example: $0 system/manager"
exit 1 exit 1
fi fi
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
then then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -23,17 +23,17 @@ fi
echo ------------------------------------- echo -------------------------------------
echo Re-Create new user echo Re-Create new user
echo ------------------------------------- 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 -------------------------------------
echo Import Reference echo Import Reference
echo ------------------------------------- echo -------------------------------------
echo imp $1@$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 imp "$1"@"$ADEMPIERE_DB_SERVER":"$ADEMPIERE_DB_PORT"/"$ADEMPIERE_DB_NAME" FILE="$IDEMPIERE_HOME"/data/Reference.dmp FROMUSER=\(reference\) TOUSER=reference
echo ------------------------------------- echo -------------------------------------
echo Check System echo Check System
echo Import may show some warnings. This is OK as long as the following does not show errors echo Import may show some warnings. This is OK as long as the following does not show errors
echo ------------------------------------- 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

View File

@ -9,7 +9,7 @@ if [ $# -le 2 ]
echo "Example: $0 system/manager idempiere idempiere" echo "Example: $0 system/manager idempiere idempiere"
exit 1 exit 1
fi fi
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ]
then then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -20,4 +20,4 @@ fi
echo ------------------------------------- echo -------------------------------------
echo Add missing translations echo Add missing translations
echo ------------------------------------- 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

View File

@ -2,4 +2,4 @@
# $Id: Start.sh,v 1.6 2005/01/22 21:59:15 jjanke Exp $ # $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

View File

@ -6,5 +6,5 @@
# SET ORACLE_SID= # SET ORACLE_SID=
# export 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

View File

@ -5,7 +5,7 @@
echo Synchronize iDempiere Database echo Synchronize iDempiere Database
echo Upgrading database $1@$ADEMPIERE_DB_NAME echo Upgrading database "$1@$ADEMPIERE_DB_NAME"
if [ $# -eq 0 ] if [ $# -eq 0 ]
then then
@ -13,7 +13,7 @@ if [ $# -eq 0 ]
echo "Example: $0 adempiere adempiere" echo "Example: $0 adempiere adempiere"
exit 1 exit 1
fi 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 then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -35,7 +35,7 @@ if [ "x$4" = "x" ]
then then
DIR_SCRIPTS=$IDEMPIERE_HOME/migration DIR_SCRIPTS=$IDEMPIERE_HOME/migration
else else
if [ `expr substr "$4" 1 1` = "/" ] if [ "${4:0:1}" = "/" ]
then then
DIR_SCRIPTS="$4" DIR_SCRIPTS="$4"
else else
@ -43,12 +43,7 @@ else
fi fi
fi fi
cd "$DIR_SCRIPTS" cd "$DIR_SCRIPTS" || (echo "ERROR: Cannot change to folder $DIR_SCRIPTS"; exit 1)
if [ $? -ne 0 ]
then
echo "ERROR: Cannot change to folder $DIR_SCRIPTS"
exit 1
fi
# Create list of files already applied - registered in AD_MigrationScript table # Create list of files already applied - registered in AD_MigrationScript table
echo "set heading off 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 select name from ad_migrationscript;" | $SILENTCMD | sed -e 's:^ ::' | grep -v '^$' | sort > $TMPFOLDER/lisDB_$$.txt
# Create list of files in the migration folder # Create list of files in the migration folder
> $TMPFOLDER/lisFS_$$.txt : > $TMPFOLDER/lisFS_$$.txt
find -type d -name $ADEMPIERE_DB_PATH | grep -v "./processes_post_migration/$ADEMPIERE_DB_PATH" | while read FOLDER find . -type d -name "$ADEMPIERE_DB_PATH" | grep -v "./processes_post_migration/$ADEMPIERE_DB_PATH" | while read -r FOLDER
do do
cd "${FOLDER}" cd "${FOLDER}" || (echo "ERROR: Cannot change to folder $FOLDER"; exit 1)
ls *.sql 2>/dev/null >> $TMPFOLDER/lisFS_$$.txt ls -- *.sql 2>/dev/null >> $TMPFOLDER/lisFS_$$.txt
cd "$DIR_SCRIPTS" cd "$DIR_SCRIPTS" || (echo "ERROR: Cannot change to folder $DIR_SCRIPTS"; exit 1)
done done
sort -o $TMPFOLDER/lisFS_$$.txt $TMPFOLDER/lisFS_$$.txt sort -o $TMPFOLDER/lisFS_$$.txt $TMPFOLDER/lisFS_$$.txt
sort -o $TMPFOLDER/lisDB_$$.txt $TMPFOLDER/lisDB_$$.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 ] if [ -s $TMPFOLDER/lisPENDING_$$.txt ]
then then
mkdir $TMPFOLDER/SyncDB_out_$$ mkdir $TMPFOLDER/SyncDB_out_$$
for FILE in `cat $TMPFOLDER/lisPENDING_$$.txt` cat $TMPFOLDER/lisPENDING_$$.txt | while read -r FILE
do do
SCRIPT=`find -name "$FILE" | grep "/$ADEMPIERE_DB_PATH/"` SCRIPT=$(find . -name "$FILE" | grep "/$ADEMPIERE_DB_PATH/")
OUTFILE=$TMPFOLDER/SyncDB_out_$$/`basename "$FILE" .sql`.out OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out
echo "Applying $SCRIPT" echo "Applying $SCRIPT"
cat "$SCRIPT" | $CMD 2>&1 | tee "$OUTFILE" $CMD < "$SCRIPT" 2>&1 | tee "$OUTFILE"
APPLIED=Y APPLIED=Y
if egrep "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1 if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
then then
MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****" MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****"
# Stop processing to allow user to fix the problem before processing additional files # Stop processing to allow user to fix the problem before processing additional files
@ -99,12 +94,12 @@ else
fi fi
if [ x$APPLIED = xY ] if [ x$APPLIED = xY ]
then then
cd "$DIR_POST" cd "$DIR_POST" || (echo "ERROR: Cannot change to folder $DIR_POST"; exit 1)
for FILE in processes_post_migration/$ADEMPIERE_DB_PATH/*.sql for FILE in processes_post_migration/"$ADEMPIERE_DB_PATH"/*.sql
do do
OUTFILE=$TMPFOLDER/SyncDB_out_$$/`basename "$FILE" .sql`.out OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out
cat "$FILE" | $CMD 2>&1 | tee "$OUTFILE" $CMD 2>&1 < "$FILE" | tee "$OUTFILE"
if egrep "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1 if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
then then
MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****" MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****"
fi fi
@ -113,7 +108,7 @@ fi
if [ -n "$MSGERROR" ] if [ -n "$MSGERROR" ]
then then
echo "$MSGERROR" 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 exit 1
fi fi
exit 0 exit 0

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/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 $ # $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 ] if [ $# -eq 0 ]
then then
@ -12,7 +12,7 @@ if [ $# -eq 0 ]
echo "Example: $0 adempiere adempiere" echo "Example: $0 adempiere adempiere"
exit 1 exit 1
fi 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 then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -24,9 +24,9 @@ fi
PGPASSWORD=$2 PGPASSWORD=$2
export PGPASSWORD 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= PGPASSWORD=
export PGPASSWORD export PGPASSWORD
cd $IDEMPIERE_HOME/data cd "$IDEMPIERE_HOME"/data || exit
jar cvfM ExpDat.jar ExpDat.dmp jar cvfM ExpDat.jar ExpDat.dmp

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/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 ] if [ $# -le 2 ]
then then
@ -10,7 +10,7 @@ if [ $# -le 2 ]
echo "Example: $0 postgres adempiere adempiere postgrespwd" echo "Example: $0 postgres adempiere adempiere postgrespwd"
exit 1 exit 1
fi 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 then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -60,35 +60,35 @@ then
# Assuming that adempiere role already exists (it was created out there) # Assuming that adempiere role already exists (it was created out there)
PGPASSWORD=$3 PGPASSWORD=$3
export PGPASSWORD 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 else
if [ "x$2" != xadempiere ] if [ "x$2" != xadempiere ]
then 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 fi
if [ $ISAMAZONRDS = Y ] if [ $ISAMAZONRDS = Y ]
then then
PGPASSWORD=$3 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 PGPASSWORD=$4
else 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 fi
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2 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" psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL"
fi fi
ADEMPIERE_CREATE_ROLE_SQL= ADEMPIERE_CREATE_ROLE_SQL=
PGPASSWORD=$3 PGPASSWORD=$3
export PGPASSWORD 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 -------------------------------------
echo Import Adempiere_pg.dmp echo Import ExpDat.dmp
echo ------------------------------------- echo -------------------------------------
ADEMPIERE_ALTER_ROLE_SQL="ALTER ROLE $2 SET search_path TO adempiere, pg_catalog" 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" -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" -f "$IDEMPIERE_HOME"/data/ExpDat.dmp
PGPASSWORD= PGPASSWORD=
export PGPASSWORD export PGPASSWORD

View File

@ -1,8 +1,8 @@
/************************************************************************* /*************************************************************************
* The contents of this file are subject to the Adempiere License. You may * The contents of this file are subject to the iDempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html * 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 * 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. * Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
************************************************************************* *************************************************************************
* $Id: Daily.sql,v 1.1 2006/12/27 globalqss Exp $ * $Id: Daily.sql,v 1.1 2006/12/27 globalqss Exp $

View File

@ -1,12 +1,12 @@
#!/bin/sh #!/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 $ # $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 then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -18,9 +18,9 @@ fi
PGPASSWORD=reference PGPASSWORD=reference
export PGPASSWORD 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= PGPASSWORD=
export PGPASSWORD export PGPASSWORD
cd $IDEMPIERE_HOME/data cd "$IDEMPIERE_HOME"/data || exit
jar cvfM Adempiere_pg.jar Adempiere_pg.dmp jar cvfM Adempiere_pg.jar Adempiere_pg.dmp

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# $Id: ImportAdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $ # $Id: ImportIdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $
echo idempiere Database Import $Revision: 1.10 $ 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 ] if [ $# -le 2 ]
then then
@ -11,7 +11,7 @@ if [ $# -le 2 ]
echo "Example: $0 postgres idempiere idempiere postgresPwd" echo "Example: $0 postgres idempiere idempiere postgresPwd"
exit 1 exit 1
fi 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 then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -51,35 +51,35 @@ then
# Assuming that adempiere role already exists (it was created out there) # Assuming that adempiere role already exists (it was created out there)
PGPASSWORD=$3 PGPASSWORD=$3
export PGPASSWORD 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 else
if [ "x$2" != xadempiere ] if [ "x$2" != xadempiere ]
then 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 fi
if [ $ISAMAZONRDS = Y ] if [ $ISAMAZONRDS = Y ]
then then
PGPASSWORD=$3 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 PGPASSWORD=$4
else 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 fi
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2 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" psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL"
fi fi
ADEMPIERE_CREATE_ROLE_SQL= ADEMPIERE_CREATE_ROLE_SQL=
PGPASSWORD=$3 PGPASSWORD=$3
export PGPASSWORD 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 -------------------------------------
echo Import Adempiere$5.dmp echo Import Adempiere"$5".dmp
echo ------------------------------------- echo -------------------------------------
ADEMPIERE_ALTER_ROLE_SQL="ALTER ROLE $2 SET search_path TO adempiere, pg_catalog" 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" -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" -f "$IDEMPIERE_HOME"/data/seed/Adempiere"$5".dmp
ADEMPIERE_ALTER_ROLE_SQL= ADEMPIERE_ALTER_ROLE_SQL=
PGPASSWORD= PGPASSWORD=
export PGPASSWORD export PGPASSWORD

View File

@ -92,7 +92,7 @@ apply_script()
OUTFILE="$2" OUTFILE="$2"
FILE="$3" FILE="$3"
echo "Applying $SCRIPT" echo "Applying $SCRIPT"
cat "$SCRIPT" | $CMD > "$OUTFILE" 2>&1 $CMD < "$SCRIPT" > "$OUTFILE" 2>&1
APPLIED=Y APPLIED=Y
if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1 if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
then then
@ -283,7 +283,7 @@ then
do do
OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out
echo "Applying $FILE" echo "Applying $FILE"
cat "$FILE" | $CMD > "$OUTFILE" 2>&1 $CMD < "$FILE" > "$OUTFILE" 2>&1
if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1 if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
then then
echo "Found error in $SCRIPT" echo "Found error in $SCRIPT"

View File

@ -9,7 +9,7 @@ if [ $# -le 2 ]
echo "Example: $0 postgres idempiere idempiere postgresPwd" echo "Example: $0 postgres idempiere idempiere postgresPwd"
exit 1 exit 1
fi 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 then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -24,6 +24,6 @@ export PGPASSWORD
echo ------------------------------------- echo -------------------------------------
echo Add missing translations echo Add missing translations
echo ------------------------------------- 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= PGPASSWORD=
export PGPASSWORD export PGPASSWORD

View File

@ -7,4 +7,4 @@ echo Start PostgreSQL DB Service
# IPC demon may be required for cygwin # IPC demon may be required for cygwin
# ipc-daemon& # ipc-daemon&
pg_ctl -o "-i" -l $PGLOG start pg_ctl -o "-i" -l "$PGLOG" start

View File

@ -5,7 +5,7 @@
echo Synchronize iDempiere Database echo Synchronize iDempiere Database
echo Upgrading database $1@$ADEMPIERE_DB_NAME echo Upgrading database "$1@$ADEMPIERE_DB_NAME"
if [ $# -eq 0 ] if [ $# -eq 0 ]
then then
@ -13,7 +13,7 @@ if [ $# -eq 0 ]
echo "Example: $0 adempiere adempiere" echo "Example: $0 adempiere adempiere"
exit 1 exit 1
fi 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 then
echo "Please make sure that the environment variables are set correctly:" echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere" echo " IDEMPIERE_HOME e.g. /idempiere"
@ -37,7 +37,7 @@ if [ "x$4" = "x" ]
then then
DIR_SCRIPTS=$IDEMPIERE_HOME/migration DIR_SCRIPTS=$IDEMPIERE_HOME/migration
else else
if [ `expr substr "$4" 1 1` = "/" ] if [ "${4:0:1}" = "/" ]
then then
DIR_SCRIPTS="$4" DIR_SCRIPTS="$4"
else else
@ -45,23 +45,18 @@ else
fi fi
fi fi
cd "$DIR_SCRIPTS" cd "$DIR_SCRIPTS" || (echo "ERROR: Cannot change to folder $DIR_SCRIPTS"; exit 1)
if [ $? -ne 0 ]
then
echo "ERROR: Cannot change to folder $DIR_SCRIPTS"
exit 1
fi
# Create list of files already applied - registered in AD_MigrationScript table # 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 echo "select name from ad_migrationscript" | $SILENTCMD | sed -e 's:^ ::' | grep -v '^$' | sort > $TMPFOLDER/lisDB_$$.txt
# Create list of files in the migration folder # Create list of files in the migration folder
> $TMPFOLDER/lisFS_$$.txt : > $TMPFOLDER/lisFS_$$.txt
find -type d -name $ADEMPIERE_DB_PATH | grep -v "./processes_post_migration/$ADEMPIERE_DB_PATH" | while read FOLDER find . -type d -name "$ADEMPIERE_DB_PATH" | grep -v "./processes_post_migration/$ADEMPIERE_DB_PATH" | while read -r FOLDER
do do
cd "${FOLDER}" cd "${FOLDER}" || (echo "ERROR: Cannot change to folder $FOLDER"; exit 1)
ls *.sql 2>/dev/null >> $TMPFOLDER/lisFS_$$.txt ls -- *.sql 2>/dev/null >> $TMPFOLDER/lisFS_$$.txt
cd "$DIR_SCRIPTS" cd "$DIR_SCRIPTS" || (echo "ERROR: Cannot change to folder $DIR_SCRIPTS"; exit 1)
done done
sort -o $TMPFOLDER/lisFS_$$.txt $TMPFOLDER/lisFS_$$.txt sort -o $TMPFOLDER/lisFS_$$.txt $TMPFOLDER/lisFS_$$.txt
sort -o $TMPFOLDER/lisDB_$$.txt $TMPFOLDER/lisDB_$$.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 ] if [ -s $TMPFOLDER/lisPENDING_$$.txt ]
then then
mkdir $TMPFOLDER/SyncDB_out_$$ mkdir $TMPFOLDER/SyncDB_out_$$
for FILE in `cat $TMPFOLDER/lisPENDING_$$.txt` cat $TMPFOLDER/lisPENDING_$$.txt | while read -r FILE
do do
SCRIPT=`find -name "$FILE" | grep "/$ADEMPIERE_DB_PATH/"` SCRIPT=$(find . -name "$FILE" | grep "/$ADEMPIERE_DB_PATH/")
OUTFILE=$TMPFOLDER/SyncDB_out_$$/`basename "$FILE" .sql`.out OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out
echo "Applying $SCRIPT" echo "Applying $SCRIPT"
cat "$SCRIPT" | $CMD 2>&1 | tee "$OUTFILE" $CMD < "$SCRIPT" 2>&1 | tee "$OUTFILE"
APPLIED=Y APPLIED=Y
if egrep "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1 if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
then then
MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****" MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****"
# Stop processing to allow user to fix the problem before processing additional files # Stop processing to allow user to fix the problem before processing additional files
@ -96,12 +91,12 @@ else
fi fi
if [ x$APPLIED = xY ] if [ x$APPLIED = xY ]
then then
cd "$DIR_POST" cd "$DIR_POST" || (echo "ERROR: Cannot change to folder $DIR_POST"; exit 1)
for FILE in processes_post_migration/$ADEMPIERE_DB_PATH/*.sql for FILE in processes_post_migration/"$ADEMPIERE_DB_PATH"/*.sql
do do
OUTFILE=$TMPFOLDER/SyncDB_out_$$/`basename "$FILE" .sql`.out OUTFILE=$TMPFOLDER/SyncDB_out_$$/$(basename "$FILE" .sql).out
cat "$FILE" | $CMD 2>&1 | tee "$OUTFILE" $CMD 2>&1 < "$FILE" | tee "$OUTFILE"
if egrep "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1 if grep -E "$ERROR_STRINGS" "$OUTFILE" > /dev/null 2>&1
then then
MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****" MSGERROR="$MSGERROR\n**** ERROR ON FILE $OUTFILE - Please verify ****"
fi fi
@ -112,7 +107,7 @@ export PGPASSWORD
if [ -n "$MSGERROR" ] if [ -n "$MSGERROR" ]
then then
echo "$MSGERROR" 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 exit 1
fi fi
exit 0 exit 0

View File

@ -3,7 +3,7 @@ Version: 7.1
Section: web Section: web
Priority: extra Priority: extra
Architecture: all 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 Suggests: firefox
Installed-Size: 968668 Installed-Size: 968668
Maintainer: Carlos Ruiz <carg67@gmail.com> Maintainer: Carlos Ruiz <carg67@gmail.com>

View File

@ -40,13 +40,13 @@ esac
IDEMPIERE_USER=idempiere IDEMPIERE_USER=idempiere
IDEMPIERE_HOME=/opt/idempiere-server 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 # 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=$(ls -r /usr/lib/jvm/java-1[1234]-openjdk*/bin/javac | head -1)
JAVA_HOME=`dirname $JAVA_HOME` JAVA_HOME=$(dirname "$JAVA_HOME")
SU=su SU=su
export IDEMPIERE_HOME export IDEMPIERE_HOME
export TELNET_PORT=12612 export TELNET_PORT=12612
if [ $(id -u) != "0" ] if [ "$(id -u)" != "0" ]
then then
echo "You must be root to run the configure script. Login as root and then run the configure script." echo "You must be root to run the configure script. Login as root and then run the configure script."
exit 1 exit 1
@ -56,7 +56,7 @@ RETVAL=0
IDEMPIERESTATUS= IDEMPIERESTATUS=
MAXSECONDS=120 # max wait 2 minutes MAXSECONDS=120 # max wait 2 minutes
SLEEPSECONDS=2 SLEEPSECONDS=2
MAXITERATIONS=`expr $MAXSECONDS / $SLEEPSECONDS` MAXITERATIONS=$((MAXSECONDS / SLEEPSECONDS))
CONFIG_NAME=idempiere CONFIG_NAME=idempiere
CONFIGURATION="/etc/sysconfig/$CONFIG_NAME" CONFIGURATION="/etc/sysconfig/$CONFIG_NAME"
@ -184,7 +184,6 @@ RUN_AT_STARTUP=${RUN_AT_STARTUP:-false}
CONFIGURE_RUN=${CONFIGURE_RUN} CONFIGURE_RUN=${CONFIGURE_RUN}
EOF EOF
if [ $? != 0 ] if [ $? != 0 ]
then then
return 1 return 1
@ -245,7 +244,7 @@ configure_perform()
! !
echo "Done" echo "Done"
fi 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 ] if [ $? -ne 0 ]
then then
echo "Error deploying iDempiere, please verify and try again" echo "Error deploying iDempiere, please verify and try again"
@ -288,7 +287,7 @@ configure_perform()
checkportused() 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" ] if [ "$port" = "$1" ]
then then
return 0 # Used return 0 # Used
@ -322,18 +321,18 @@ EOF
#get the http port value #get the http port value
while : while :
do do
while [ 1 ] while :
do do
echo -n Specify the HTTP port that will be used for iDempiere server [8080]: echo -n "Specify the HTTP port that will be used for iDempiere server [8080]:"
read LINE read -r LINE
if [ -z $LINE ] if [ -z "$LINE" ]
then then
LINE=8080 LINE=8080
fi fi
if checkportused "$LINE" if checkportused "$LINE"
then then
echo Port $port appears to be in use by another application.\ echo "Port $port appears to be in use by another application.
Please specify a different port. Please specify a different port."
else else
break; break;
fi fi
@ -356,18 +355,18 @@ EOF
#get the https port value #get the https port value
while : while :
do do
while [ 1 ] while :
do do
echo -n Specify the HTTPS port that will be used for iDempiere server [8443]: echo -n "Specify the HTTPS port that will be used for iDempiere server [8443]:"
read LINE read -r LINE
if [ -z $LINE ] if [ -z "$LINE" ]
then then
LINE=8443 LINE=8443
fi fi
if checkportused "$LINE" if checkportused "$LINE"
then then
echo Port $port appears to be in use by another application.\ echo "Port $port appears to be in use by another application.
Please specify a different port. Please specify a different port."
else else
break; break;
fi fi
@ -391,23 +390,23 @@ EOF
while : while :
do do
echo -n "Specify a password to be used for adempiere database account:" echo -n "Specify a password to be used for adempiere database account:"
while [ 1 ] while :
do do
stty -echo > /dev/null 2>&1 stty -echo > /dev/null 2>&1
temp=`echo $IFS` temp=$(echo "$IFS")
export IFS="\n" export IFS="\n"
while [ 1 ] while :
do do
read LINE read -r LINE
while [ -z "$LINE" ] while [ -z "$LINE" ]
do do
echo echo
echo -n "Password can't be null. Enter password:" echo -n "Password can't be null. Enter password:"
read LINE read -r LINE
done done
result=`expr index "$LINE" [\'\"]` result=$(expr index "$LINE" [\'\"])
if [ $result != 0 ]; if [ "$result" != 0 ];
then then
echo echo
echo -n "The password you entered contains invalid characters. Enter password:" echo -n "The password you entered contains invalid characters. Enter password:"
@ -417,7 +416,7 @@ EOF
done done
echo echo
echo -n "Confirm the password:" echo -n "Confirm the password:"
read LINE1 read -r LINE1
echo echo
if [ "$LINE" != "$LINE1" ]; if [ "$LINE" != "$LINE1" ];
then then
@ -438,21 +437,21 @@ EOF
do do
echo -n "Specify the password of the user postgres on postgres database echo -n "Specify the password of the user postgres on postgres database
(if empty then local connection will be tried):" (if empty then local connection will be tried):"
while [ 1 ] while :
do do
stty -echo > /dev/null 2>&1 stty -echo > /dev/null 2>&1
temp=`echo $IFS` temp=`echo $IFS`
export IFS="\n" export IFS="\n"
while [ 1 ] while :
do do
read LINE read -r LINE
if [ -z "$LINE" ] if [ -z "$LINE" ]
then then
break break
fi fi
result=`expr index "$LINE" [\'\"]` result=$(expr index "$LINE" [\'\"])
if [ $result != 0 ]; if [ "$result" != 0 ];
then then
echo echo
echo -n "The password you entered contains invalid characters. Enter password:" echo -n "The password you entered contains invalid characters. Enter password:"
@ -500,16 +499,10 @@ Enter postgres password:"
while : while :
do do
if [ "${RUN_AT_STARTUP}" = "true" ]
then
CUR=y
else
CUR=n
fi
echo echo
echo -n "Do you want iDempiere ERP Server to be started on boot (y/n) [y]:" echo -n "Do you want iDempiere ERP Server to be started on boot (y/n) [y]:"
read LINE read -r LINE
if [ -z $LINE ] if [ -z "$LINE" ]
then then
RUN_AT_STARTUP=true RUN_AT_STARTUP=true
fi fi
@ -535,7 +528,7 @@ Enter postgres password:"
getidempierestatus() { getidempierestatus() {
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep) IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep)
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME} echo "$IDEMPIERESTATUSSTRING" | grep -q ${IDEMPIERE_HOME}
IDEMPIERESTATUS=$? IDEMPIERESTATUS=$?
} }
@ -550,8 +543,8 @@ configure()
configure_perform configure_perform
CONFIGURE_RUN=true CONFIGURE_RUN=true
write_sysconfig write_sysconfig
echo To access the iDempiere Server Home Page, start the server with 'systemctl start idempiere' 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 "and then go to \"http://127.0.0.1:${ADEMPIERE_WEB_PORT}\""
} }
@ -570,7 +563,7 @@ start () {
return 1 return 1
fi fi
echo -n "Starting iDempiere ERP: " 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 "mkdir -p $IDEMPIERE_HOME/log"
$SU ${IDEMPIERE_USER} -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &" $SU ${IDEMPIERE_USER} -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
RETVAL=$? RETVAL=$?
@ -580,9 +573,9 @@ start () {
ITERATIONS=0 ITERATIONS=0
while [ $STATUSTEST -eq 0 ] ; do while [ $STATUSTEST -eq 0 ] ; do
sleep $SLEEPSECONDS sleep $SLEEPSECONDS
cat $LOGFILE | grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' && STATUSTEST=1 grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' < "$LOGFILE" && STATUSTEST=1
echo -n "." echo -n "."
ITERATIONS=`expr $ITERATIONS + 1` ITERATIONS=$((ITERATIONS + 1))
if [ $ITERATIONS -gt $MAXITERATIONS ] if [ $ITERATIONS -gt $MAXITERATIONS ]
then then
break break
@ -618,7 +611,7 @@ stop () {
return 1 return 1
fi fi
echo -n "Stopping iDempiere ERP: " 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 # try shutdown from OSGi console, then direct kill with signal 15, then signal 9
log_warning_msg "Trying shutdown from OSGi console" log_warning_msg "Trying shutdown from OSGi console"
( echo exit; echo y; sleep 5 ) | telnet localhost ${TELNET_PORT} > /dev/null 2>&1 ( 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" log_success_msg "Service stopped with OSGi shutdown"
else else
log_warning_msg "Trying direct kill with signal -15" 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 sleep 5
getidempierestatus getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then if [ $IDEMPIERESTATUS -ne 0 ] ; then
log_success_msg "Service stopped with kill -15" log_success_msg "Service stopped with kill -15"
else else
log_warning_msg "Trying direct kill with signal -9" 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 sleep 5
getidempierestatus getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then if [ $IDEMPIERESTATUS -ne 0 ] ; then

View File

@ -1,24 +1,25 @@
#!/bin/sh
TMP=/tmp TMP=/tmp
cd `dirname $0`/../../.. cd "$(dirname "$0")"/../../.. || exit
IDEMPIERE_HOME=`pwd` IDEMPIERE_HOME=$(pwd)
RWD=$IDEMPIERE_HOME/idempiere-server/utils/unix RWD=$IDEMPIERE_HOME/idempiere-server/utils/unix
PACKAGE=`ls -d $IDEMPIERE_HOME` PACKAGE=$(ls -d "$IDEMPIERE_HOME")
PACKAGE=`basename $PACKAGE` PACKAGE=$(basename "$PACKAGE")
# VERSION=dev # VERSION=dev
# TIMESTAMP=`date +%Y%m%d` # TIMESTAMP=$(date +%Y%m%d)
# PACKFILE=$IDEMPIERE_HOME/../${PACKAGE}_${VERSION}_${TIMESTAMP}.deb # PACKFILE=$IDEMPIERE_HOME/../${PACKAGE}_${VERSION}_${TIMESTAMP}.deb
PACKFILE=$IDEMPIERE_HOME/../${PACKAGE}.deb PACKFILE=$IDEMPIERE_HOME/../${PACKAGE}.deb
find $RWD/../.. -name "*.sh" -exec chmod +x {} \; find "$RWD"/../.. -name "*.sh" -exec chmod +x {} \;
chmod +x $RWD/DebianInstaller/etc/init.d/idempiere 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 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 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 gzip -v -9 $TMP/control.tar
tar cvf $TMP/data.tar -C $RWD/DebianInstaller/ ./usr 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 --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 rvf $TMP/data.tar -C "$RWD"/DebianInstaller/ ./etc
gzip -v -9 $TMP/data.tar gzip -v -9 $TMP/data.tar
cd $TMP cd $TMP || exit
ar q $PACKFILE debian-binary control.tar.gz data.tar.gz ar q "$PACKFILE" debian-binary control.tar.gz data.tar.gz
rm debian-binary control.tar.gz data.tar.gz rm debian-binary control.tar.gz data.tar.gz
echo "Created $PACKFILE" echo "Created $PACKFILE"

View File

@ -34,7 +34,7 @@ MAXITERATIONS=60
getidempierestatus() { getidempierestatus() {
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep) IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep)
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME} echo "$IDEMPIERESTATUSSTRING" | grep -q ${IDEMPIERE_HOME}
IDEMPIERESTATUS=$? IDEMPIERESTATUS=$?
} }
@ -45,9 +45,9 @@ start () {
return 1 return 1
fi fi
echo -n "Starting iDempiere ERP: " echo -n "Starting iDempiere ERP: "
cd $IDEMPIERE_HOME/utils cd $IDEMPIERE_HOME/utils || exit
. $ENVFILE . $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 "mkdir -p $IDEMPIERE_HOME/log"
su $IDEMPIEREUSER -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &" su $IDEMPIEREUSER -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
RETVAL=$? RETVAL=$?
@ -57,10 +57,10 @@ start () {
ITERATIONS=0 ITERATIONS=0
while [ $STATUSTEST -eq 0 ] ; do while [ $STATUSTEST -eq 0 ] ; do
sleep 2 sleep 2
cat $LOGFILE | grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' && STATUSTEST=1 grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' < "$LOGFILE" && STATUSTEST=1
echo -n "." echo -n "."
ITERATIONS=`expr $ITERATIONS + 1` ITERATIONS=$((ITERATIONS + 1))
if [ $ITERATIONS -gt $MAXITERATIONS ] if [ "$ITERATIONS" -gt $MAXITERATIONS ]
then then
break break
fi fi
@ -87,7 +87,7 @@ stop () {
return 1 return 1
fi fi
echo -n "Stopping iDempiere ERP: " echo -n "Stopping iDempiere ERP: "
cd $IDEMPIERE_HOME/utils cd $IDEMPIERE_HOME/utils || exit
. $ENVFILE . $ENVFILE
# try shutdown from OSGi console, then direct kill with signal 15, then signal 9 # try shutdown from OSGi console, then direct kill with signal 15, then signal 9
log_warning_msg "Trying shutdown from OSGi console" log_warning_msg "Trying shutdown from OSGi console"
@ -97,14 +97,14 @@ stop () {
log_success_msg "Service stopped with OSGi shutdown" log_success_msg "Service stopped with OSGi shutdown"
else else
log_warning_msg "Trying direct kill with signal -15" 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 sleep 5
getidempierestatus getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then if [ $IDEMPIERESTATUS -ne 0 ] ; then
log_success_msg "Service stopped with kill -15" log_success_msg "Service stopped with kill -15"
else else
log_warning_msg "Trying direct kill with signal -9" 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 sleep 5
getidempierestatus getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then if [ $IDEMPIERESTATUS -ne 0 ] ; then
@ -159,7 +159,7 @@ case "$1" in
status status
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|condrestart|status}" echo "Usage: $0 {start|stop|restart|condrestart|status}"
exit 1 exit 1
esac esac

View File

@ -30,7 +30,7 @@ MAXITERATIONS=60 # 2 seconds every iteration, max wait 2 minutes
getidempierestatus() { getidempierestatus() {
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep) IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep)
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME} echo "$IDEMPIERESTATUSSTRING" | grep -q ${IDEMPIERE_HOME}
IDEMPIERESTATUS=$? IDEMPIERESTATUS=$?
} }
@ -41,9 +41,9 @@ start () {
return 1 return 1
fi fi
echo -n "Starting iDempiere ERP: " echo -n "Starting iDempiere ERP: "
cd $IDEMPIERE_HOME/utils cd $IDEMPIERE_HOME/utils || exit
source $ENVFILE 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 "mkdir -p $IDEMPIERE_HOME/log"
su $IDEMPIEREUSER -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &" su $IDEMPIEREUSER -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
RETVAL=$? RETVAL=$?
@ -53,9 +53,9 @@ start () {
ITERATIONS=0 ITERATIONS=0
while [ $STATUSTEST -eq 0 ] ; do while [ $STATUSTEST -eq 0 ] ; do
sleep 2 sleep 2
cat $LOGFILE | grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' && STATUSTEST=1 grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' < "$LOGFILE" && STATUSTEST=1
echo -n "." echo -n "."
ITERATIONS=`expr $ITERATIONS + 1` ITERATIONS=$((ITERATIONS + 1))
if [ $ITERATIONS -gt $MAXITERATIONS ] if [ $ITERATIONS -gt $MAXITERATIONS ]
then then
break break
@ -83,7 +83,7 @@ stop () {
return 1 return 1
fi fi
echo -n "Stopping iDempiere ERP: " echo -n "Stopping iDempiere ERP: "
cd $IDEMPIERE_HOME/utils cd $IDEMPIERE_HOME/utils || exit
source $ENVFILE source $ENVFILE
# try shutdown from OSGi console, then direct kill with signal 15, then signal 9 # try shutdown from OSGi console, then direct kill with signal 15, then signal 9
echo "Trying shutdown from OSGi console" echo "Trying shutdown from OSGi console"
@ -93,14 +93,14 @@ stop () {
echo_success echo_success
else else
echo "Trying direct kill with signal -15" 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 sleep 5
getidempierestatus getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then if [ $IDEMPIERESTATUS -ne 0 ] ; then
echo_success echo_success
else else
echo "Trying direct kill with signal -9" 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 sleep 5
getidempierestatus getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then if [ $IDEMPIERESTATUS -ne 0 ] ; then

View File

@ -59,7 +59,7 @@ MAXITERATIONS=60
getidempierestatus() { getidempierestatus() {
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep) IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep ${IDEMPIERE_HOME} | grep -v grep)
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME} echo "$IDEMPIERESTATUSSTRING" | grep -q ${IDEMPIERE_HOME}
IDEMPIERESTATUS=$? IDEMPIERESTATUS=$?
} }
@ -71,9 +71,9 @@ start () {
return return
fi fi
echo -n "Starting iDempiere ERP: " echo -n "Starting iDempiere ERP: "
cd $IDEMPIERE_HOME/utils cd $IDEMPIERE_HOME/utils || exit
. $ENVFILE . $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 "mkdir -p $IDEMPIERE_HOME/log"
su $IDEMPIEREUSER -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &" su $IDEMPIEREUSER -c "export TELNET_PORT=$TELNET_PORT;cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
RETVAL=$? RETVAL=$?
@ -83,9 +83,9 @@ start () {
ITERATIONS=0 ITERATIONS=0
while [ $STATUSTEST -eq 0 ] ; do while [ $STATUSTEST -eq 0 ] ; do
sleep 2 sleep 2
cat $LOGFILE | grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' && STATUSTEST=1 grep -q '.*LoggedSessionListener.contextInitialized: context initialized.*' < "$LOGFILE" && STATUSTEST=1
echo -n "." echo -n "."
ITERATIONS=`expr $ITERATIONS + 1` ITERATIONS=$((ITERATIONS + 1))
if [ $ITERATIONS -gt $MAXITERATIONS ] if [ $ITERATIONS -gt $MAXITERATIONS ]
then then
break break
@ -114,7 +114,7 @@ stop () {
return return
fi fi
echo -n "Stopping iDempiere ERP: " echo -n "Stopping iDempiere ERP: "
cd $IDEMPIERE_HOME/utils cd $IDEMPIERE_HOME/utils || exit
. $ENVFILE . $ENVFILE
# try shutdown from OSGi console, then direct kill with signal 15, then signal 9 # try shutdown from OSGi console, then direct kill with signal 15, then signal 9
log_warning_msg "Trying shutdown from OSGi console" log_warning_msg "Trying shutdown from OSGi console"
@ -124,14 +124,14 @@ stop () {
echo "Service stopped with OSGi shutdown" echo "Service stopped with OSGi shutdown"
else else
echo "Trying direct kill with signal -15" 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 sleep 5
getidempierestatus getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then if [ $IDEMPIERESTATUS -ne 0 ] ; then
echo "Service stopped with kill -15" echo "Service stopped with kill -15"
else else
echo "Trying direct kill with signal -9" 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 sleep 5
getidempierestatus getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then if [ $IDEMPIERESTATUS -ne 0 ] ; then
@ -193,7 +193,7 @@ case "$1" in
status status
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|condrestart|status}" echo "Usage: $0 {start|stop|restart|condrestart|status}"
exit 1 exit 1
esac esac

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# #
cd $(dirname "${0}") cd "$(dirname "${0}")" || (echo "Cannot cd"; exit 1)
DESTINATION=$(pwd) DESTINATION=$(pwd)
VMOPTS="-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true" 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" -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" -i "$2"

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
cd $(dirname "${0}") cd "$(dirname "${0}")" || (echo "Cannot cd"; exit 1)
DESTINATION=$(pwd) DESTINATION=$(pwd)
cp idempiere.ini idempiere.ini.sav cp idempiere.ini idempiere.ini.sav
@ -33,7 +33,7 @@ then
cp jettyhome/etc/jetty-selector.xml jetty-selector.xml.sav cp jettyhome/etc/jetty-selector.xml jetty-selector.xml.sav
fi 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 cp idempiere.ini.sav idempiere.ini