comparison debian/noffle-cronfetch @ 442:fc3e4fc0a88d noffle

[svn] update
author godisch
date Wed, 25 Jun 2003 16:34:53 +0100
parents 3b5b7f3fd71f
children
comparison
equal deleted inserted replaced
441:28949d048822 442:fc3e4fc0a88d
1 #!/bin/sh 1 #!/bin/sh
2 # $Id: noffle-cronfetch 434 2003-02-14 13:54:32Z godisch $ 2 # $Id: noffle-cronfetch 585 2003-06-25 15:34:53Z godisch $
3 # 3 #
4 # noffle script to fetch articles, run from cron 4 # noffle script to fetch articles, run from cron
5 5
6 exec > /dev/null 2>&1 6 exec > /dev/null 2>&1
7 7
12 12
13 [ "$NOFFLE_FETCHMODE" = cron ] || exit 0 13 [ "$NOFFLE_FETCHMODE" = cron ] || exit 0
14 14
15 if [ -f "$LOCKFILE" ]; then 15 if [ -f "$LOCKFILE" ]; then
16 # check if pid still exists 16 # check if pid still exists
17 if kill -0 `cat $LOCKFILE`; then 17 if kill -0 `cat "$LOCKFILE"`; then
18 logger -i -p news.info -t noffle-cronfetch -- "previous instance still running" 18 logger -i -p news.info -t noffle-cronfetch -- "previous instance still running"
19 exit 0 19 exit 0
20 fi 20 fi
21 # false lock 21 # false lock
22 logger -i -p news.warning -t noffle-cronfetch -- "removing stale lock $LOCKFILE" 22 logger -i -p news.warning -t noffle-cronfetch -- "removing stale lock $LOCKFILE"
23 rm -f $LOCKFILE 23 rm -f "$LOCKFILE"
24 fi 24 fi
25 25
26 trap 'rm -f $LOCKFILE' 0 1 2 15 26 trap 'rm -f "$LOCKFILE"' 0 1 2 15
27 27
28 echo $$ > $LOCKFILE 28 echo "$$" > "$LOCKFILE"
29 $NOFFLE --fetch 29 "$NOFFLE" --fetch
30 rm -f $LOCKFILE 30 rm -f "$LOCKFILE"
31 31
32 trap '' 0 32 trap '' 0
33 exit 0 33 exit 0