aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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
+}