On Fri, Mar 25, 2011 at 10:01 AM, Kenneth Gonsalves lawgon@thenilgiris.comwrote:
On Fri, 2011-03-25 at 01:34 +0530, Rony Bill wrote:
I am happy to announce that the application is finally ready.
url?
No url available but I am posting the 2 scripts. Create 2 text files called 'employees' and 'present'. In the 'employees' file add your single names (no space) one below the other.
The main script is called 'muster' and is given below.
#!/bin/bash echo -e "Welcome to Your Company" echo -n "Please enter your name: " read -e USER if grep -q "$USER" employees then echo "Thank you for your entry." else echo "Sorry! Your name does not appear in our records." exit fi if grep -q "$USER" present then echo "Sorry! You have already logged in today." else DATE=$(date +%d-%m-%Y) MONTH=$(date +%b-%Y) CUR=$(date +%s) REF=$(date +%s -d 'today 10am') DIFF=$(( $CUR - $REF )) streamer -c /dev/video0 -b 16 -q -o $USER.jpeg convert $USER.jpeg -resize 60x40 $USER-$DATE.jpeg rm -f $USER.jpeg MIN=$(($DIFF/60)) echo "$DATE $USER $MIN" >> $USER-$MONTH.csv echo "$USER" >> present fi exit
The other script is called 'absent' and is given below.
#!/bin/bash
DATE=$(date +%d-%m-%Y) MONTH=$(date +%b-%Y)
for i in $(cat employees); do if grep -q "$i" present then echo > /dev/null else echo "$DATE $i Absent" >> $i-$MONTH.csv fi done
All you need is a linux compatible webcam and the 2 scripts and the 2 text files and you are ready with the Low Cost Attendance Registering System with Biometrics. This script will run even on older machines that cannot handle server software.
-- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/