annotate debian/init @ 458:187f5d684589 noffle

[svn] updated standards version
author godisch
date Wed, 09 Jul 2003 18:52:33 +0100
parents fb4e5f59f4a7
children 0c7220ddf348
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
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
2 # $Id: init 595 2003-06-25 16:36:44Z 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)
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
34 echo "Initializing offline news server..."
334
08222dbe6eb0 [svn] cleanup
godisch
parents: 303
diff changeset
35 if [ "$NOFFLE_FETCHMODE" = ppp ]; then
442
fc3e4fc0a88d [svn] update
godisch
parents: 435
diff changeset
36 "$NOFFLE" --offline
334
08222dbe6eb0 [svn] cleanup
godisch
parents: 303
diff changeset
37 else
442
fc3e4fc0a88d [svn] update
godisch
parents: 435
diff changeset
38 "$NOFFLE" --online
334
08222dbe6eb0 [svn] cleanup
godisch
parents: 303
diff changeset
39 fi
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
40 echo "Done."
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
41 ;;
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
42 stop)
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
43 echo "Switching offline news server into offline mode..."
442
fc3e4fc0a88d [svn] update
godisch
parents: 435
diff changeset
44 "$NOFFLE" --offline
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
45 echo "Done."
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
46 ;;
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
47 restart)
435
aae1f2906cea [svn] updated init script output
godisch
parents: 383
diff changeset
48 echo "No action done, as noffle is restarted upon each query."
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
49 ;;
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
50 reload|force-reload)
435
aae1f2906cea [svn] updated init script output
godisch
parents: 383
diff changeset
51 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
52 ;;
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
53 status)
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
54 help
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
55 exit 4 # LSB: program or service status is unknown
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
56 ;;
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
57 online|offline)
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
58 echo "Switching offline news server into $1 mode..."
442
fc3e4fc0a88d [svn] update
godisch
parents: 435
diff changeset
59 "$NOFFLE" --$1
452
fb4e5f59f4a7 [svn] fixed look of status messages
godisch
parents: 442
diff changeset
60 echo "Done."
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
61 ;;
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
62 *)
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
63 help
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
64 exit 2 # LSB: invalid or excess argument(s)
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
65 ;;
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