#!/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 "mandrake"
fi

cp extra/*sh /usr/bin
chmod 755 /usr/bin/read_cert_from_sc.sh
chmod 755 /usr/bin/read_cert_from_pkcs12.sh
cp extra/opensc.conf /etc
