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