forked from ForumMagnum/ForumMagnum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlesswrongDB.sh
More file actions
22 lines (16 loc) · 880 Bytes
/
lesswrongDB.sh
File metadata and controls
22 lines (16 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
echo "Do you want to export your current MongoDB database? (Y/N)"
read exportDB
if [ "$(exportDB)" == "Y"]; then
echo "Exporting current Database..."
echo "${purple}(this requires the Mongo development tools. If this fails install the mongo dev tools with ${blue} brew install mongodb ${purple} or your local equivalent"
mongodump -h 127.0.0.1 --port 3001 -d meteor | bash;
echo "Do you want to import a local MongoDB database? (Y/N)"
read importDB
if [ "$(importDB)" == "Y"]; then
echo "${purple}(this requires the Mongo development tools. If this fails install the mongo dev tools with ${blue} brew install mongodb ${purple} or your local equivalent"
echo "What is the file path of the database you want to import? (Default is /dump)"
read filepath
mongorestore -h 127.0.0.1 --port 3001 $(filepath) | bash;
if tput setaf 1 &> /dev/null; then
tput sgr0;
fi