您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

14 行
573 B

  1. #!/bin/bash
  2. if [ -z $1 ]; then
  3. echo "No dump provided. Usage: $0 201..._lesspass_db.sql"
  4. exit 1
  5. fi
  6. DUMP_FILENAME=$1
  7. docker cp $DUMP_FILENAME lesspass_db_1:$DUMP_FILENAME
  8. docker exec -it lesspass_db_1 sh -c 'PGPASSWORD=$POSTGRES_PASSWORD dropdb -U $POSTGRES_USER $POSTGRES_DB'
  9. docker exec -it lesspass_db_1 sh -c 'PGPASSWORD=$POSTGRES_PASSWORD createdb -U $POSTGRES_USER $POSTGRES_DB'
  10. docker exec -it lesspass_db_1 sh -c 'PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER -h localhost -p 5432 < '$DUMP_FILENAME''
  11. docker exec -it lesspass_db_1 rm $DUMP_FILENAME