#!/bin/sh
#
# Copyright (C) 2002-2004 by NCHC, Steven Shiau, K. L. Huang
# (steven@nchc.org.tw, c00hkl00@nchc.org.tw)
#
# 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, 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.
#

DRBL_SCRIPT_PATH="/opt/drbl"
drbl_setup_path="$DRBL_SCRIPT_PATH/setup"
PARAM="$@"
echo "******************************************************"
grep "Red Hat Linux release 8.0 (Psyche)" /etc/redhat-release 2>/dev/null && OS_Version="RH8.0"
grep "Red Hat Linux release 9 (Shrike)" /etc/redhat-release 2>/dev/null && OS_Version="RH9"
grep "Fedora Core release 1 (Yarrow)" /etc/fedora-release 2>/dev/null && OS_Version="RHFC1"
grep "Fedora Core release 2 (Tettnang)" /etc/fedora-release 2>/dev/null && OS_Version="RHFC2"
grep "Mandrake Linux release 9.2 (FiveStar) for i586" /etc/mandrake-release 2>/dev/null && OS_Version="MDK9.2"
grep "Mandrake Linux release 10.0 (Community) for i586" /etc/mandrake-release 2> /dev/null && OS_Version="MDK10.0"
grep "Mandrake Linux release 10.0 (Official) for i586" /etc/mandrake-release 2> /dev/null && OS_Version="MDK10.0"
echo "******************************************************"
case "$OS_Version" in
RH8|RH8.0|RH9|RH9.0|"RHfc1"|"RHFC1"|"Fedora Core 1"|"RHfc2"|"RHFC2"|"Fedora Core 2")
            echo "The version number you entered is $OS_Version."
	    $drbl_setup_path/drblsrv-rh $PARAM
            ;;
"MDK9.2"|"mdk9.2"|"MDK10.0")
            echo "The version number you entered is $OS_Version."
	    $drbl_setup_path/drblsrv-mdk $PARAM
            ;;
*)
            echo "This version is NOT supported by DRBL, program stop!."
            echo "Please press ctrl-c to stop the program!"
            exit 1 
esac
