annotate debian/init @ 496:a5a37849dc04 noffle

Fix man page ugliness. Debian bug Bug#432392.
author Jim Hague <jim.hague@acm.org>
date Tue, 10 Jul 2007 18:25:21 +0100
parents 0c7220ddf348
children
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
469
0c7220ddf348 [svn] fixed output and return code
godisch
parents: 452
diff changeset
2 # $Id: init 615 2003-08-31 15:16:28Z 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
469
0c7220ddf348 [svn] fixed output and return code
godisch
parents: 452
diff changeset
14 # echo "Cannot execute noffle: program not found." >&2
0c7220ddf348 [svn] fixed output and return code
godisch
parents: 452
diff changeset
15 # exit 5 # LSB: program is not installed
0c7220ddf348 [svn] fixed output and return code
godisch
parents: 452
diff changeset
16 exit 0 # Debian policy: exit quietly, see #206928
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
17 fi
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
18
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
19 if [ "$2" ]; then
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
20 help
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
21 exit 2 # LSB: invalid or excess argument(s)
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
22 fi
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
23
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
24 if [ -x /usr/sbin/pppd ]; then
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
25 NOFFLE_FETCHMODE="ppp"
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
26 else
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
27 NOFFLE_FETCHMODE="cron"
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
28 fi
371
82457f16cf43 [svn] fixed policy compliance
godisch
parents: 341
diff changeset
29 if [ -f /etc/default/noffle ]; then
82457f16cf43 [svn] fixed policy compliance
godisch
parents: 341
diff changeset
30 . /etc/default/noffle
82457f16cf43 [svn] fixed policy compliance
godisch
parents: 341
diff changeset
31 fi
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
32
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
33 case "$1" in
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
34 start)
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
35 echo "Initializing offline news server..."
334
08222dbe6eb0 [svn] cleanup
godisch
parents: 303
diff changeset
36 if [ "$NOFFLE_FETCHMODE" = ppp ]; then
442
fc3e4fc0a88d [svn] update
godisch
parents: 435
diff changeset
37 "$NOFFLE" --offline
334
08222dbe6eb0 [svn] cleanup
godisch
parents: 303
diff changeset
38 else
442
fc3e4fc0a88d [svn] update
godisch
parents: 435
diff changeset
39 "$NOFFLE" --online
334
08222dbe6eb0 [svn] cleanup
godisch
parents: 303
diff changeset
40 fi
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
41 echo "Done."
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
42 ;;
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
43 stop)
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
44 echo "Switching offline news server into offline mode..."
442
fc3e4fc0a88d [svn] update
godisch
parents: 435
diff changeset
45 "$NOFFLE" --offline
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
46 echo "Done."
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
47 ;;
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
48 restart)
435
aae1f2906cea [svn] updated init script output
godisch
parents: 383
diff changeset
49 echo "No action done, as noffle is restarted upon each query."
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
50 ;;
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
51 reload|force-reload)
435
aae1f2906cea [svn] updated init script output
godisch
parents: 383
diff changeset
52 echo "No action done, as noffle reloads its configuration upon each query."
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
53 ;;
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
54 status)
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
55 help
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
56 exit 4 # LSB: program or service status is unknown
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
57 ;;
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
58 online|offline)
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
59 echo "Switching offline news server into $1 mode..."
442
fc3e4fc0a88d [svn] update
godisch
parents: 435
diff changeset
60 "$NOFFLE" --$1
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
61 echo "Done."
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
62 ;;
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
63 *)
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
64 help
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
65 exit 2 # LSB: invalid or excess argument(s)
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
66 esac
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
67
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
68 exit 0