#!/bin/sh

kernel=`uname -r | grep ^2.6`
if [ -z "$kernel" ]; then
  echo "Kernel 2.6+ required. Exiting..."
  exit 0
fi


iscon=`cat /etc/issue | grep Conectiva`
isfedora=`cat /etc/issue | grep Fedora`
ismk=`cat /etc/issue | grep Mandrake`

if [ ! -z "$isfedora" ]; then
   echo "Using Fedora installer..."
  ./fd/install
elif [ ! -z "$iscon" ]; then
  echo "Using Conectiva installer..."
  ./cl_mk/install
elif [ ! -z "$ismk" ]; then
  echo "Using Mandrake installer..."
  ./cl_mk/install
fi

cp extra/opensc.conf /etc

cd ./extra
if ! mozilla file://$PWD/loadModule.htm 2> /dev/null
then
  echo "Mdulo PKCS#11 no carregado. Aplicativo mozilla no foi encontrado."
fi
  
cd ..
