Created
October 3, 2023 23:55
-
-
Save akshithg/068d9b24b0e030644bb94a8857f7bdb6 to your computer and use it in GitHub Desktop.
Switch neo4j db on community edition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
to=$1 | |
active=$(cat /etc/neo4j/neo4j.conf | grep "initial.dbms.default_database" | cut -d'=' -f2) | |
echo "changing from *$active* to *$to*" | |
sudo sed -i "s/initial.dbms.default_database=$active/initial.dbms.default_database=$to/g" /etc/neo4j/neo4j.conf | |
echo "Restarting..." | |
sudo service neo4j restart | |
new=$(cat /etc/neo4j/neo4j.conf | grep "initial.dbms.default_database" | cut -d'=' -f2) | |
if [ "$new" = "$to" ]; | |
then | |
echo "Success!" | |
else | |
echo "Failed!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment