Created
June 4, 2018 17:55
-
-
Save cristianounix/7984978b3d00cafa0b926c083ee739a2 to your computer and use it in GitHub Desktop.
Restore database in your container (named database)
This file contains 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
#!/bin/bash | |
if [ -s "$1" ] | |
then | |
if [ "$(docker inspect -f {{.State.Running}} database)" != "true" ] | |
then | |
echo "Container MySql is not running" | |
exit 1 | |
fi | |
else | |
echo "Syntax: $0 <filename>" | |
exit 1 | |
fi | |
cat $1 | docker exec -i database /usr/bin/mysql -uroot -proot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment