301
|
1 #!/bin/sh
|
371
|
2 # $Id: init 511 2003-04-02 11:05:33Z godisch $
|
301
|
3
|
371
|
4 set -e
|
|
5 NOFFLE=/usr/bin/noffle
|
|
6 [ -x "$NOFFLE" ] || exit 0
|
301
|
7
|
|
8 if [ -x /usr/sbin/pppd ]; then
|
|
9 NOFFLE_FETCHMODE="ppp"
|
|
10 else
|
|
11 NOFFLE_FETCHMODE="cron"
|
|
12 fi
|
371
|
13 if [ -f /etc/default/noffle ]; then
|
|
14 . /etc/default/noffle
|
|
15 fi
|
301
|
16
|
|
17 case "$1" in
|
303
|
18 online|offline)
|
|
19 echo "Switching offline news server to $1 mode: noffle."
|
|
20 $NOFFLE --$1
|
|
21 ;;
|
301
|
22 start)
|
|
23 echo "Initializing offline news server: noffle."
|
334
|
24 if [ "$NOFFLE_FETCHMODE" = ppp ]; then
|
337
|
25 $NOFFLE --offline
|
334
|
26 else
|
337
|
27 $NOFFLE --online
|
334
|
28 fi
|
301
|
29 ;;
|
|
30 stop)
|
303
|
31 $0 offline
|
301
|
32 ;;
|
371
|
33 reload|force-reload|restart)
|
301
|
34 ;;
|
|
35 *)
|
371
|
36 echo "Usage: $0 {start|stop|online|offline}" >&2
|
301
|
37 exit 1
|
|
38 ;;
|
|
39 esac
|
|
40
|
|
41 exit 0
|