annotate debian/noffle-cronfetch @ 357:b0ee77fa24d4 noffle

[svn] * src/post.c,src/configfile.c,src/configfile.h,docs/noffle.conf.5, noffle.conf.example,TODO: Added a config value to specify whether a Reply-To header should be appended to messages posted without it. Also made the new option show up in the noffle.conf manpage and the initial example configuration shipped with the package.
author bears
date Mon, 24 Mar 2003 23:32:48 +0000
parents 3b5b7f3fd71f
children fc3e4fc0a88d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
1 #!/bin/sh
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
2 # $Id: noffle-cronfetch 434 2003-02-14 13:54:32Z godisch $
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
3 #
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
4 # noffle script to fetch articles, run from cron
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
5
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
6 exec > /dev/null 2>&1
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
7
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
8 LOCKFILE=/var/lock/noffle/noffle-cronfetch.pid
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
9 NOFFLE=/usr/bin/noffle
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
10
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
11 . /etc/default/noffle
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
12
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
13 [ "$NOFFLE_FETCHMODE" = cron ] || exit 0
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
14
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
15 if [ -f "$LOCKFILE" ]; then
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
16 # check if pid still exists
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
17 if kill -0 `cat $LOCKFILE`; then
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
18 logger -i -p news.info -t noffle-cronfetch -- "previous instance still running"
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
19 exit 0
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
20 fi
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
21 # false lock
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
22 logger -i -p news.warning -t noffle-cronfetch -- "removing stale lock $LOCKFILE"
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
23 rm -f $LOCKFILE
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
24 fi
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
25
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
26 trap 'rm -f $LOCKFILE' 0 1 2 15
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
27
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
28 echo $$ > $LOCKFILE
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
29 $NOFFLE --fetch
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
30 rm -f $LOCKFILE
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
31
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
32 trap '' 0
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
33 exit 0