File: update-reader.conf

package info (click to toggle)
pcsc-lite 1.0.2.beta5-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,880 kB
  • ctags: 1,165
  • sloc: sh: 9,016; ansic: 6,752; lex: 219; makefile: 175; perl: 69
file content (81 lines) | stat: -rw-r--r-- 2,368 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#! /bin/sh
#
# This is the update-reader.conf script for Debian GNU/Linux.
# Written by Ludovic Rousseau <ludovic.rousseau@free.fr>
# Based on update-modules written by Wichert Akkerman <wakkerma@debian.org>
# Copyright (C) 2001 Software in the Public Interest
#

#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA


# $Id: update-reader.conf,v 1.1 2001/09/22 18:52:57 cprados Exp $

CFGFILE=/etc/reader.conf
TMPFILE="${CFGFILE}.$!"
HEADER="### This file is automatically generated by update-reader.conf"

set -e

# Reset the sorting order since we depend on it
LC_COLLATE=C
export LC_COLLATE

if [ -f $CFGFILE ]; then
	if ! sed -ne 1p $CFGFILE | grep -q "^$HEADER" ; then
		echo "Error: the current $CFGFILE is not automatically generated."
		if [ "$1" != "force" ]; then
			echo "Use \"update-reader.conf force\" to force (re)generation."
			exit 1
		else
			echo "force specified, (re)generating file anyway."
		fi
	fi
fi

if [ 0 -ne "`id -u`" ]; then
	echo "You have to be root to do this."
	exit 2
fi

if [ -e $CFGFILE ]; then
  cp -f $CFGFILE ${CFGFILE}.old
fi

echo $HEADER > $TMPFILE
cat <<EOF >> $TMPFILE
#
# Please do not edit this file directly. If you want to change or add
# anything please take a look at the files in /etc/reader.conf.d/ and
# read the manpage for update-reader.conf.
#
EOF

for cfg in /etc/reader.conf.d/* $CONF ; do
	if ! echo $cfg | grep -q '\(\.dpkg-[a-z]*\|~\)$' ; then
		echo "### update-reader.conf: start processing $cfg" >> $TMPFILE
		if [ -x $cfg ]; then
			$cfg >> $TMPFILE
		else
			cat $cfg >> $TMPFILE
		fi
		echo >> $TMPFILE
		echo "### update-reader.conf: end processing $cfg" >> $TMPFILE
		echo >> $TMPFILE
	fi
done

mv $TMPFILE $CFGFILE