From: Markus Koschany <apo@debian.org>
Date: Wed, 24 Aug 2022 19:59:52 +0200
Subject: openrefine-bin

---
 refine | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/refine b/refine
index 044670a..3852bf1 100755
--- a/refine
+++ b/refine
@@ -9,7 +9,7 @@
 fail () {
    cat <<EOF
 ERROR: $1
-Type '$0 -h' for usage information.
+Type 'openrefine -h' for usage information.
 EOF
 exit 1
 }
@@ -26,7 +26,7 @@ warn() {
 
 usage() {
     cat <<EOF
-Usage: $0 [options] <action>
+Usage: openrefine [options] <action>
 where [options] include:
 
   -h print this message and exit
@@ -299,12 +299,6 @@ dist_prepare() {
     fi
 }
 
-tools_prepare() {
-    if [ ! -d $REFINE_TOOLS_DIR ] ; then 
-        mkdir $REFINE_TOOLS_DIR || error "Error while making directory $REFINE_TOOLS_DIR"
-    fi
-}
-
 mvn_prepare() {
     tools_prepare
 
@@ -833,6 +827,16 @@ fi
 
 checkJavaMajorVersion
 
+# ----- Load configurations -------------------------------------
+
+if [ -z $REFINE_INI_PATH ]; then
+  REFINE_INI_PATH=/etc/openrefine/refine.ini
+fi
+
+echo "Using ${REFINE_INI_PATH} for configuration"
+load_configs $REFINE_INI_PATH
+
+
 # ----- Parse the command line args ------------------------------------------
 
 while [ $# -ne 0 ] ; do
@@ -863,15 +867,6 @@ if [ -z "$ACTION" ] ; then
     ACTION="run"
 fi
 
-# ----- Load configurations -------------------------------------
-
-if [ -z $REFINE_INI_PATH ]; then
-  REFINE_INI_PATH=refine.ini
-fi
-
-echo "Using ${REFINE_INI_PATH} for configuration"
-load_configs $REFINE_INI_PATH
-
 # ----- Verify and Set Required Environment Variables -------------------------
 
 if [ -z "$JAVA_OPTIONS" ] ; then
@@ -942,7 +937,7 @@ if [ -z "$REFINE_CLASSES_DIR" ] ; then
 fi
 
 if [ -z "$REFINE_LIB_DIR" ] ; then
-    REFINE_LIB_DIR="server/target/lib"
+    REFINE_LIB_DIR="server"
 fi
 
 if [ -z "$REFINE_BUILD_DIR" ] ; then
