#!/bin/sh # Merge all reader config file snippets for pcsc-lite from a reader.conf.d # directory into a reader.conf. CONF=/etc/reader.conf CONFDIR=/etc/reader.conf.d umask 0022 set -e trap cleanup EXIT cleanup() { test -z "$tmpfile" || rm -f "$tmpfile" } tmpfile=`mktemp /tmp/reader.conf.XXXXXX` cat > "$tmpfile" << EOF # Configuration file for pcsc-lite # # Don't modify this file. Instead put a file or modify the files in # /etc/reader.conf.d/ and run /usr/sbin/update-reader.conf # afterwards. Note that when starting pcscd with the init script, # update-reader.conf will be run automatically. # # Note also that this file should include configuration for serial and PCMCIA # readers only; USB readers should _not_ be configured here. EOF for f in `ls -1d "$CONFDIR"/*.conf 2>/dev/null` ; do echo "# $f" >> "$tmpfile" cat "$f" >> "$tmpfile" echo >> "$tmpfile" done echo "# End of file" >> "$tmpfile" cat "$tmpfile" > "$CONF"