annotate debian/init @ 383:863270a06774 noffle

[svn] fixed output
author godisch
date Fri, 18 Apr 2003 20:52:16 +0100
parents 11cca625263f
children aae1f2906cea
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
383
863270a06774 [svn] fixed output
godisch
parents: 374
diff changeset
2 # $Id: init 523 2003-04-18 19:52:16Z godisch $
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
3
371
82457f16cf43 [svn] fixed policy compliance
godisch
parents: 341
diff changeset
4 set -e
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
5
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
6 PATH="/bin:/usr/bin:/sbin:/usr/sbin"
374
11cca625263f [svn] minor fix
godisch
parents: 373
diff changeset
7 NOFFLE="/usr/bin/noffle"
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
8
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
9 help () {
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
10 echo "Usage: /etc/init.d/noffle { online | offline }" >&2
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
11 }
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
12
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
13 if [ ! -x "$NOFFLE" ]; then
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
14 echo "Cannot execute noffle: program not found." >&2
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
15 exit 5 # LSB: program is not installed
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
16 fi
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
17
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
18 if [ "$2" ]; then
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
19 help
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
20 exit 2 # LSB: invalid or excess argument(s)
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
21 fi
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
22
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
23 if [ -x /usr/sbin/pppd ]; then
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
24 NOFFLE_FETCHMODE="ppp"
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
25 else
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
26 NOFFLE_FETCHMODE="cron"
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
27 fi
371
82457f16cf43 [svn] fixed policy compliance
godisch
parents: 341
diff changeset
28 if [ -f /etc/default/noffle ]; then
82457f16cf43 [svn] fixed policy compliance
godisch
parents: 341
diff changeset
29 . /etc/default/noffle
82457f16cf43 [svn] fixed policy compliance
godisch
parents: 341
diff changeset
30 fi
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
31
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
32 case "$1" in
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
33 start)
383
863270a06774 [svn] fixed output
godisch
parents: 374
diff changeset
34 echo -n "Initializing offline news server: "
334
08222dbe6eb0 [svn] cleanup
godisch
parents: 303
diff changeset
35 if [ "$NOFFLE_FETCHMODE" = ppp ]; then
337
1aa1ed030464 [svn] cleanup bugfix
godisch
parents: 334
diff changeset
36 $NOFFLE --offline
334
08222dbe6eb0 [svn] cleanup
godisch
parents: 303
diff changeset
37 else
337
1aa1ed030464 [svn] cleanup bugfix
godisch
parents: 334
diff changeset
38 $NOFFLE --online
334
08222dbe6eb0 [svn] cleanup
godisch
parents: 303
diff changeset
39 fi
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
40 ;;
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
41 stop)
383
863270a06774 [svn] fixed output
godisch
parents: 374
diff changeset
42 echo -n "Switching offline news server into offline mode: "
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
43 $NOFFLE --offline
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
44 ;;
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
45 restart)
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
46 echo -n "Restarting offline news server: noffle"
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
47 ;;
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
48 reload|force-reload)
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
49 echo -n "Reloading offline news server configuration: noffle"
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
50 ;;
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
51 status)
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
52 help
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
53 exit 4 # LSB: program or service status is unknown
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
54 ;;
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
55 online|offline)
383
863270a06774 [svn] fixed output
godisch
parents: 374
diff changeset
56 echo -n "Switching offline news server into $1 mode: "
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
57 $NOFFLE --$1
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
58 ;;
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
59 *)
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
60 help
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
61 exit 2 # LSB: invalid or excess argument(s)
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
62 ;;
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
63 esac
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
64 echo "."
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
65
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
66 exit 0