|
30 | 30 | # Print the environment variable NEO4J_HOME that is used to execute the command |
31 | 31 | echo "setupNeo4jInitialPassword: Using ${NEO4J_INSTALLATION_DIRECTORY} as NEO4J_HOME" |
32 | 32 |
|
| 33 | +# Extract the first component of the version number (=major version number) |
| 34 | +NEO4J_MAJOR_VERSION_NUMBER=$(echo "$NEO4J_VERSION" | cut -d'.' -f1) |
| 35 | +echo "setupNeo4jInitialPassword: Neo4j version ${NEO4J_MAJOR_VERSION_NUMBER} detected" |
| 36 | + |
33 | 37 | isWindows=false |
34 | 38 | if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then |
35 | 39 | isWindows=true |
36 | 40 | fi |
37 | 41 | echo "setupNeo4jInitialPassword: Detected isWindows=${isWindows} for operating system type ${OSTYPE}" |
38 | 42 |
|
39 | | -# Extract the first component of the version number (=major version number) |
40 | | -NEO4J_MAJOR_VERSION_NUMBER=$(echo "$NEO4J_VERSION" | cut -d'.' -f1) |
41 | | - |
42 | 43 | # Check if the first component is greater than or equal to 5 |
43 | 44 | if [[ "$NEO4J_MAJOR_VERSION_NUMBER" -ge 5 ]]; then |
44 | | - echo "setupNeo4jInitialPassword: Neo4j v5 or higher detected" |
| 45 | + echo "setupNeo4jInitialPassword: Neo4j v5 or higher used" |
45 | 46 | # Neo4j version < 5 |
46 | 47 | # Set the initial password using a temporary NEO4J_HOME environment variable pointing to the current setup |
47 | 48 | if [ "${isWindows}" = true ] ; then |
48 | | - NEO4J_HOME="${NEO4J_INSTALLATION_DIRECTORY}" "${NEO4J_INSTALLATION_DIRECTORY}/bin/neo4j-admin.bat" dbms set-initial-password "${NEO4J_INITIAL_PASSWORD}" |
| 49 | + NEO4J_HOME="${NEO4J_INSTALLATION_DIRECTORY}" | "${NEO4J_INSTALLATION_DIRECTORY}/bin/neo4j-admin.bat" dbms set-initial-password "${NEO4J_INITIAL_PASSWORD}" |
49 | 50 | else |
50 | | - NEO4J_HOME="${NEO4J_INSTALLATION_DIRECTORY}" "${NEO4J_INSTALLATION_DIRECTORY}/bin/neo4j-admin" dbms set-initial-password "${NEO4J_INITIAL_PASSWORD}" |
| 51 | + NEO4J_HOME="${NEO4J_INSTALLATION_DIRECTORY}" | "${NEO4J_INSTALLATION_DIRECTORY}/bin/neo4j-admin" dbms set-initial-password "${NEO4J_INITIAL_PASSWORD}" |
51 | 52 | fi |
52 | 53 | else |
53 | | - echo "setupNeo4jInitialPassword: Neo4j v4 or lower detected" |
| 54 | + echo "setupNeo4jInitialPassword: Neo4j v4 or lower used" |
54 | 55 | # Neo4j version >= 5 |
55 | 56 | # Set the initial password using a temporary NEO4J_HOME environment variable pointing to the current setup |
56 | 57 | if [ "${isWindows}" = true ] ; then |
57 | | - NEO4J_HOME="${NEO4J_INSTALLATION_DIRECTORY}" "${NEO4J_INSTALLATION_DIRECTORY}/bin/neo4j-admin.bat" set-initial-password "${NEO4J_INITIAL_PASSWORD}" |
| 58 | + NEO4J_HOME="${NEO4J_INSTALLATION_DIRECTORY}" | "${NEO4J_INSTALLATION_DIRECTORY}/bin/neo4j-admin.bat" set-initial-password "${NEO4J_INITIAL_PASSWORD}" |
58 | 59 | else |
59 | | - NEO4J_HOME="${NEO4J_INSTALLATION_DIRECTORY}" "${NEO4J_INSTALLATION_DIRECTORY}/bin/neo4j-admin" set-initial-password "${NEO4J_INITIAL_PASSWORD}" |
| 60 | + NEO4J_HOME="${NEO4J_INSTALLATION_DIRECTORY}" | "${NEO4J_INSTALLATION_DIRECTORY}/bin/neo4j-admin" set-initial-password "${NEO4J_INITIAL_PASSWORD}" |
60 | 61 | fi |
61 | 62 | fi |
62 | 63 |
|
|
0 commit comments