Skip to content
This repository was archived by the owner on Jun 18, 2022. It is now read-only.

Commit 83dcfaa

Browse files
author
Dmitriy "DK" Korobskiy
committed
* Script for switching DBs
** Fixes
1 parent 65e502d commit 83dcfaa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Neo4j/neo4j_switch_db.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
if [[ $1 == "-h" || $# -lt 1 ]]; then
2+
if [[ $1 == "-h" || $# -lt 2 ]]; then
33
cat <<'HEREDOC'
44
NAME
55
neo4j_switch_db.sh -- switches Neo4j active DB and restarts Neo4j
@@ -38,11 +38,11 @@ db_name="$1"
3838

3939
# region Hide password from the output
4040
set +x
41-
echo "$3" | sudo --stdin -u neo4j bash -c "set -xe
41+
echo "$2" | sudo --stdin -u neo4j bash -c "set -xe
4242
sed --in-place --expression='s/dbms.active_database=.*/dbms.active_database=${db_name}/' /etc/neo4j/neo4j.conf"
4343

4444
echo "Restarting Neo4j with a new active database ..."
45-
echo "$3" | sudo --stdin systemctl restart neo4j
45+
echo "$2" | sudo --stdin systemctl restart neo4j
4646

4747
declare -i time_limit_s=30
4848
echo "Waiting for the service to become active up to ${time_limit_s} seconds ..."

0 commit comments

Comments
 (0)