From 9330113df08676ec82639aec8cca290709b7936e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 27 Sep 2011 18:07:24 -0300 Subject: Action backup-site now dumping db and storing things in the right place --- lib/hydra/misc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/hydra/misc b/lib/hydra/misc index 90dd4b8..9bcc9df 100644 --- a/lib/hydra/misc +++ b/lib/hydra/misc @@ -1,6 +1,6 @@ #!/bin/bash -# Set needed environment variables and do basic checks. +# Set needed environment variables and do basic checks function hydra_set_env { export CONFIG="$HOME/.hydra/config" export ACTION="$1" @@ -26,7 +26,7 @@ function hydra_user_input { fi } -# Install a package. +# Install a package function hydra_install_package { if [ -z "$1" ]; then return @@ -38,3 +38,10 @@ function hydra_install_package { DEBIAN_FRONTEND=noninteractive apt-get install $1 -y fi } + +# Truncate a database +function hydra_truncate_database { + if [ ! -z "$1" ]; then + mysql puppet -e "drop database $1; create database $1;" + fi +} -- cgit v1.2.3