301
|
1 #!/bin/sh
|
341
|
2 # $Id: init 477 2003-03-04 22:16:42Z 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
|
341
|
12 [ -f /etc/default/noffle ] && . /etc/default/noffle || :
|
301
|
13
|
|
14 [ -x "$NOFFLE" ] || exit 0
|
|
15
|
|
16 case "$1" in
|
303
|
17 online|offline)
|
|
18 echo "Switching offline news server to $1 mode: noffle."
|
|
19 $NOFFLE --$1
|
|
20 ;;
|
301
|
21 start)
|
|
22 echo "Initializing offline news server: noffle."
|
334
|
23 if [ "$NOFFLE_FETCHMODE" = ppp ]; then
|
337
|
24 $NOFFLE --offline
|
334
|
25 else
|
337
|
26 $NOFFLE --online
|
334
|
27 fi
|
301
|
28 ;;
|
|
29 stop)
|
303
|
30 $0 offline
|
301
|
31 ;;
|
|
32 restart|force-reload)
|
|
33 $0 start
|
|
34 ;;
|
|
35 *)
|
|
36 echo "Usage: $0 {start|stop}" >&2
|
|
37 exit 1
|
|
38 ;;
|
|
39 esac
|
|
40
|
|
41 exit 0
|