# Pre/pos-installation setup of Libchipcard set -e PATH=/bin:/usr/bin:/sbin:/usr/sbin PREFIX=${PKG_PREFIX:-} CHIPCARDC_CFGFILE=/etc/chipcardc.conf CHIPCARDD_CFGFILE=/etc/chipcardd.conf # check if we were called correctly file_exists() { echo "+---------------" echo "| The configuration file $1 already exists" echo "| However, an example file has been installed to " echo "| ${PREFIX}/share/libchipcard/examples." echo "| You may use it for comparison." echo "+---------------" } file_doesnt_exist() { echo "+---------------" echo "| The configuration file $1 does not exist." echo "| An example file has been installed to" echo "| ${PREFIX}/share/libchipcard/examples." echo "| Please edit this file and rename it to $1." echo "+---------------" } daemonstart() { echo "+---------------" echo "| After verifying the configuration files you" echo "| need to start the chipcard daemon in order" echo "| to access the card reader(s)." echo "| To start the chipcard daemon enter" echo "| ${PREFIX}/sbin/chipcardd" echo "| Please see man (1) chipcardd." echo "+---------------" } case $2 in PRE-INSTALL) # nothing ;; POST-INSTALL) if test -f $CHIPCARDC_CFGFILE; then file_exists $CHIPCARDC_CFGFILE else file_doesnt_exist $CHIPCARDC_CFGFILE fi if test -f $CHIPCARDD_CFGFILE; then file_exists $CHIPCARDD_CFGFILE else file_doesnt_exist $CHIPCARDD_CFGFILE fi ;; *) echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL}" >&2 exit 1 ;; esac daemonstart exit 0