#!/bin/sh
# vim:set sw=4 ts=4:
#
# $Id: make_mysql,v 1.3 2005/04/11 14:14:39 fabian Exp $
#
#############################################################################
#
# ALICE
# Automatic Linux Installation and Configuration Environment
#
# Copyright (c) 2000 SuSE Linux Solutions AG, Eschborn, Germany
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#############################################################################
#
# Author: Fabian Herschel
#
############################################################################
#
# make_mysql
#
# Sections: mysql
# Tags:     MY_CNF, MYSQL_ACCESS
#
############################################################################
#
# NOTES:
#
############################################################################
#

test -n "$alice_dir" || alice_dir="/usr/lib/alice2/"
export alice_dir

while [ $# -gt 0 ]
do
   case $1 in
       -h | --help | -? ) usage
                          exit 1
                          ;;
       -fqhn ) export fqhn=$2; shift
            ;;

   esac
   shift
done   

. $alice_dir/lib/alicerc

WELCOME
std_mycnf_conf=/etc/my.cnf
std_mysqlaccess=/etc/mysqlaccess.conf
#
############################################################################
#
# First priority is on a special inetd.con file
#
GET_CONFIGURATION --optional mysql $CFG_DEBUG
#
# my.cnf
#
if [ -n "$MY_CNF" ]
then
   #
   # save the old configuration
   #
   test -f "$std_mycnf_conf" && BACKUP --error ${std_mycnf_conf}
   #
   echo "$MY_CNF" > $std_mycnf_conf
fi
#
# mysqlaccess.conf
#
if [ -n "$MYSQL_ACCESS" ]
then
   #
   # save the old configuration
   # 
   test -f "$std_mysqlaccess" &&  BACKUP --error ${std_mysqlaccess}
   #
   echo "$MYSQL_ACCESS" > $std_mysqlaccess
fi
#
############################################################################
# Thats all
GOOD_BYE 
