summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-09-27 18:07:24 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-09-27 18:07:24 -0300
commit9330113df08676ec82639aec8cca290709b7936e (patch)
tree93600833840c1d0f6d7420511335bf12bfc51195 /lib
parentc040869beb026ecc309bf1c2ccf627261f41bc46 (diff)
downloadhydra-9330113df08676ec82639aec8cca290709b7936e.tar.gz
hydra-9330113df08676ec82639aec8cca290709b7936e.tar.bz2
Action backup-site now dumping db and storing things in the right place
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/misc11
1 files changed, 9 insertions, 2 deletions
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
+}