301
|
1 #!/bin/sh
|
303
|
2 # $Id: init 437 2003-02-16 08:47:33Z 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
|
|
12 [ -f /etc/default/noffle ] && . /etc/default/noffle
|
|
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."
|
|
23 [ "$NOFFLE_FETCHMODE" = ppp ] && $NOFFLE --offline
|
|
24 [ "$NOFFLE_FETCHMODE" = cron ] && $NOFFLE --online
|
|
25 ;;
|
|
26 stop)
|
303
|
27 $0 offline
|
301
|
28 ;;
|
|
29 restart|force-reload)
|
|
30 $0 start
|
|
31 ;;
|
|
32 *)
|
|
33 echo "Usage: $0 {start|stop}" >&2
|
|
34 exit 1
|
|
35 ;;
|
|
36 esac
|
|
37
|
|
38 exit 0
|