#!/bin/sh
#****************************************************************
# *     Copyright (C) 2003, Wistron Inc.  All Rights Reserved.
# *     File Name:              wsmbdrvpkg
# *     Author:                 Jerry Zhou
# *     Create Time:    2003-05-15 15:06:12
# *     Last Update:    2003-05-29 13:50:04 by Jerry Zhou
#****************************************************************
if uname -r|grep "2\.4\.18-14" 1>/dev/null 2>/dev/null ; then
        echo "Abort! Linux Redhat 8.0 is not supported now!"
        exit 1
fi
if uname -r|grep "2\.4\.18-3" 1>/dev/null 2>/dev/null ; then
        echo "Abort! Linux Redhat 7.3 is not supported now!"
        exit 1
fi

pkg_mid="rhe3"
tmp=`uname -r`
if echo $tmp | grep "2\.4\.20-8" 1>/dev/null 2>/dev/null ; then
        pkg_mid="rh90"
fi
if echo $tmp | grep "2\.4\.18-14" 1>/dev/null 2>/dev/null ; then
        pkg_mid="rh80"
fi
if echo $tmp | grep "2\.4\.18-3" 1>/dev/null 2>/dev/null ; then
        pkg_mid="rh73"
fi
if echo $tmp | grep "2\.4\.21-4" 1>/dev/null 2>/dev/null ; then
        pkg_mid="rhe3"
fi

pkg_name=wsmbdrv-1.5-0.$pkg_mid.i386.rpm
pkg_key=wsmbdrv-1.5-0.$pkg_mid

case $1 in
        install)
                rpm -i --force $pkg_name
                ;;
        uninstall)
                rpm -e $pkg_key
                ;;
        *)
                echo "Usage: wsmbdrvpkg {install | uninstall}"
                exit 1
esac

exit 0
