Skip to content

Instantly share code, notes, and snippets.

@Houdini
Created November 13, 2012 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Houdini/4068397 to your computer and use it in GitHub Desktop.
Save Houdini/4068397 to your computer and use it in GitHub Desktop.
#!/bin/bash
function check_fail(){
if test $1 -ne 0; then
echo " Installation failed. LSB package may not be installed.
Install LSB package and reinstall CryptoPro CSP. If it does not help, please
read installation documentation or contact the manufacturer: support@cryptopro.ru."
exit $1
fi
}
cd `dirname $0`
/bin/sh ./uninstall.sh || exit $?
case `uname -m` in
x86_64|amd64)
ARG=64
arch=x86_64
;;
*)
arch=i486
;;
esac
[ -r /etc/debian_version ] && debian=1
[ -r /etc/lsb-release ] && grep -q Ubuntu /etc/lsb-release && debian=1
echo "Installing lsb-cprocsp-base-3.6.1-4.noarch.rpm..."
if test x$debian = x1; then
alien -kci lsb-cprocsp-base-3.6.1-4.noarch.rpm || check_fail $?
else
rpm -i lsb-cprocsp-base-3.6.1-4.noarch.rpm || check_fail $?
fi
list="lsb-cprocsp-rdr lsb-cprocsp-capilite lsb-cprocsp-kc1"
for i in $list; do
if test x$ARG = x64 && [ -e lsb-cprocsp-rdr-64-3.6.1-4.$arch.rpm ]; then
i="${i}-64"
fi
echo "Installing $i..."
if test x$debian = x1; then
alien -kci $i-3.6.1-4.$arch.rpm || check_fail $?
else
rpm -i $i-3.6.1-4.$arch.rpm || check_fail $?
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment