From 4c8e2839949be4603fbb8fb9e7a7e536e59c1dc4 Mon Sep 17 00:00:00 2001 From: Elijah Saxon Date: Mon, 4 Jul 2005 06:39:00 +0000 Subject: created ninjahelper --- handlers/mysql.helper | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 handlers/mysql.helper (limited to 'handlers/mysql.helper') diff --git a/handlers/mysql.helper b/handlers/mysql.helper new file mode 100644 index 0000000..765f228 --- /dev/null +++ b/handlers/mysql.helper @@ -0,0 +1,109 @@ + +do_mysql_user() { + inputBox "mysql action wizard" "specify a system user:" + do_mysql_final "user = $REPLY" +} + +do_mysql_password() { + inputBox "mysql action wizard" "specify a mysql user:" + user=$REPLY + inputBox "mysql action wizard" "specify the mysql user's password:" + password=$REPLY + do_mysql_final "dbusername = $user\ndbpassword = $password" +} + +do_mysql_debian() { + _DISABLE_HOTCOPY=yes + do_mysql_final "configfile = /etc/mysql/debian.cnf" +} + +do_mysql_user() { + inputBox "mysql action wizard" "what system user does mysql backup use?" + do_mysql_final "user = $REPLY" +} + +do_mysql_final() { + if [ -z "$_DISABLE_HOTCOPY" ]; then + checkBox "mysql action wizard" "check options" \ + "sqldump" "create a backup using mysqldump (more compat)." off \ + "hotcopy" "create a backup using mysqlhotcopy (faster)." on \ + "compress" "compress the sql output files" on + status=$? + sqldump="sqldump = off" + hotcopy="hotcopy = off" + else + checkBox "mysql action wizard" "check options" \ + "compress" "compress the sql output files" on + status=$? + sqldump="sqldump = on" + hotcopy="hotcopy = off" + fi + + [ $status = 1 ] && return; + result="$REPLY" + compress="compress = off" + for opt in $result; do + case $opt in + '"sqldump"') sqldump="sqldump = on";; + '"hotcopy"') hotcopy="hotcopy = on";; + '"compress"') compress="compress = on";; + esac + done + get_next_filename $configdirectory/20.mysql + echo -e $@ > $next_filename + cat >> $next_filename < $helptmp <