- explicitly link against libgcrypt. Should fix build failure with
binutils-gold. Closes: #556920
* Make sure to install sample init file. Closes: #565986
+ * Clean up init file a little bit to prevent errors from grep.
-- Tollef Fog Heen <tfheen@debian.org> Wed, 27 Jan 2010 22:15:44 +0100
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Description of the service"
+CONFIGFILE=/etc/yubikeyd.conf
NAME=yubikeyd
DAEMON=/usr/sbin/$NAME
-DAEMON_ARGS="-c /etc/yubikeyd.conf"
+DAEMON_ARGS="-c $CONFIGFILE"
PIDFILE=/var/run/yubikeyd/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
-U=$(grep ^user= /etc/yubikeyd.conf| cut -d= -f 2)
-G=$(grep ^group= /etc/yubikeyd.conf| cut -d= -f 2)
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
+if ! [ -r "$CONFIGFILE" ]; then
+ echo "Configuration file $CONFIGFILE does not exist or is not readable"
+ exit 1
+fi
+
+U=$(grep ^user= $CONFIGFILE| cut -d= -f 2)
+G=$(grep ^group= $CONFIGFILE| cut -d= -f 2)
+
#
# Function that starts the daemon/service
#