Sophie

Sophie

distrib > Mandriva > 9.2 > i586 > media > contrib > by-pkgid > 312f213617670c714a5a7a3fef52497d > files > 2

camdump-1.01-0.4mdk.i586.rpm

#!/bin/sh
#---------------------------------------------------------------
# Project         : Mandrake Linux
# Module          : dynamic
# File            : camdump.hook
# Version         : 
# Author          : Aaron Peromsik
# Created On      : 22-Dec-02
# License         : GPL
# Purpose         : hook to run camdump
#---------------------------------------------------------------

[ -r /etc/camdump ] || exit 0
[ -r /var/run/console.lock ] || exit 0

. /etc/dynamic/scripts/functions.script

# Use the ERRORFILE for debugging, leave it /dev/null in production use
# to avoid security risks
#ERRORFILE=/tmp/camdump.errors
ERRORFILE=/dev/null

if [ $2 != camera ]; then
    exit 0
fi

if [ $1 != add ]; then
    exit 0
fi

echo $* > $ERRORFILE

USER=`cat /var/run/console.lock`
DISPLAY="localhost:0.0"
export DISPLAY
echo /bin/su $USER -c "/usr/bin/camdump" >> $ERRORFILE
/bin/su $USER -c "/usr/bin/camdump" &
# camdump.hooks ends here