#!/bin/bash

#get system version
version=`sw_vers | grep 'ProductVersion' | cut -d' ' -f2 | cut -d'.' -f2`

#if the version larger than 10.4. it should be installed pcsc_autostart
if [ "$version" -gt "4" ]; then

	#remove previous version of pcscd_autostart
	rm -rf /Library/StartupItems/pcscd_autostart

	#enable pcscd autolauncher
	launchctl load -w /Library/LaunchDaemons/org.opensc.pcscd.autostart
	/Library/OpenSC/bin/sc-securityd.py inactive
	
fi	
exit 0
