Mercurial > noffle
comparison debian/noffle-cronfetch @ 301:3b5b7f3fd71f noffle
[svn] initial debian/ upload
author | godisch |
---|---|
date | Fri, 14 Feb 2003 13:54:32 +0000 |
parents | |
children | fc3e4fc0a88d |
comparison
equal
deleted
inserted
replaced
300:994e9ab2c24f | 301:3b5b7f3fd71f |
---|---|
1 #!/bin/sh | |
2 # $Id: noffle-cronfetch 434 2003-02-14 13:54:32Z godisch $ | |
3 # | |
4 # noffle script to fetch articles, run from cron | |
5 | |
6 exec > /dev/null 2>&1 | |
7 | |
8 LOCKFILE=/var/lock/noffle/noffle-cronfetch.pid | |
9 NOFFLE=/usr/bin/noffle | |
10 | |
11 . /etc/default/noffle | |
12 | |
13 [ "$NOFFLE_FETCHMODE" = cron ] || exit 0 | |
14 | |
15 if [ -f "$LOCKFILE" ]; then | |
16 # check if pid still exists | |
17 if kill -0 `cat $LOCKFILE`; then | |
18 logger -i -p news.info -t noffle-cronfetch -- "previous instance still running" | |
19 exit 0 | |
20 fi | |
21 # false lock | |
22 logger -i -p news.warning -t noffle-cronfetch -- "removing stale lock $LOCKFILE" | |
23 rm -f $LOCKFILE | |
24 fi | |
25 | |
26 trap 'rm -f $LOCKFILE' 0 1 2 15 | |
27 | |
28 echo $$ > $LOCKFILE | |
29 $NOFFLE --fetch | |
30 rm -f $LOCKFILE | |
31 | |
32 trap '' 0 | |
33 exit 0 |