3 PIDFILE=/var/run/openlib.pid
5 if [ -e "$PIDFILE" ] ; then
6 # our pidfile exists, let's make sure the process is still running though
7 PID=`/bin/cat "$PIDFILE"`
8 if /bin/kill -0 "$PID" > /dev/null 2>&1 ; then
9 # indeed it is, i'm outta here!
10 /bin/echo 'Previous instance running...'
15 # create or update the pidfile
16 /bin/echo "$$" > $PIDFILE
21 find $upload -type f -name "*.zip" -mmin +10 -exec sh -c 'unzip $1 && rm $1' _ {} \;
22 find $upload -type f -name "*.fb2" ! -user www-data -exec chown www-data:users {} \;
23 find $upload -type f -name "*.fb2" -user www-data -mmin +10 -exec mv {} $temp \;
26 /opt/openlibrary/fb2_process.py