annotate debian/init @ 435:aae1f2906cea noffle

[svn] updated init script output
author godisch
date Tue, 24 Jun 2003 10:28:18 +0100
parents 863270a06774
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
435
aae1f2906cea [svn] updated init script output
godisch
parents: 383
diff changeset
2 # $Id: init 578 2003-06-24 09:28:18Z 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
435
aae1f2906cea [svn] updated init script output
godisch
parents: 383
diff changeset
40 echo "."
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
41 ;;
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
42 stop)
383
863270a06774 [svn] fixed output
godisch
parents: 374
diff changeset
43 echo -n "Switching offline news server into offline mode: "
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
44 $NOFFLE --offline
435
aae1f2906cea [svn] updated init script output
godisch
parents: 383
diff changeset
45 echo "."
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)
383
863270a06774 [svn] fixed output
godisch
parents: 374
diff changeset
58 echo -n "Switching offline news server into $1 mode: "
373
62b17f6d0269 [svn] made init script LSB compliant
godisch
parents: 371
diff changeset
59 $NOFFLE --$1
435
aae1f2906cea [svn] updated init script output
godisch
parents: 383
diff changeset
60 echo "."
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