Skip to content

Fix dump-db to not ask for prefix after successful dump #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions provision-contest/ansible/roles/mysql_server/files/dump-db
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,9 @@ if [ -f "/home/domjudge/db-dumps/${1}.sql.gz" ]; then
while true; do
read -p "Overwrite existing database dump (y/N)? " yn
case $yn in
[Yy]* ) create_database_dump $1; exit 0;;
''|[Nn]* ) break;;
[Yy]* ) break ;;
''|[Nn]* ) exit 0;;
esac
done
else
create_database_dump $1
fi

read -p "Provide prefix or say 'no' to abort. Format: [prefix]-$1 " prefix
case $prefix in
''|[Nn]o|[Nn] ) exit 2; break;;
* ) create_database_dump ${prefix}-${1}; break;;
esac
create_database_dump $1
Loading