]> arthur.barton.de Git - netatalk.git/blob - distrib/debian/netatalk.init
Made new -pre6 release.
[netatalk.git] / distrib / debian / netatalk.init
1 #!/bin/sh
2
3 test -x /usr/sbin/atalkd || exit 0
4
5 servername=$(/bin/hostname --short)
6
7 # Enable PAP (AppleTalk Printer Access Protocol) daemon
8 # (default yes)
9 ENABLE_PAP=yes
10
11 case "$1" in
12     start)
13         echo -n "Starting AppleTalk Daemons (this will take a while):"
14         /usr/sbin/atalkd
15         echo -n " atalkd"
16
17         /usr/bin/nbprgstr -p 4 "$servername:Workstation"
18         /usr/bin/nbprgstr -p 4 "$servername:netatalk"
19
20         /usr/sbin/afpd -n "$servername"
21         echo -n " afpd"
22         
23         if [ "$ENABLE_PAP" = "yes" ]; then
24             /usr/sbin/papd
25             echo -n " papd"
26         fi
27         
28         echo "."
29     ;;
30
31     stop)
32         echo -n "Stopping AppleTalk Daemons:"
33         echo -n " afpd"; \
34         start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/afpd
35
36         if [ -f /var/run/papd.pid ]; then
37             echo -n " papd"; \
38             start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/papd
39         fi
40
41         echo -n " atalkd"; \
42         start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/atalkd
43
44         echo "."
45     ;;
46     
47     restart)
48         $0 force-reload
49     ;;
50
51     force-reload)
52         echo -n "Restarting AppleTalk Daemons (this will take a while)"
53         /etc/init.d/netatalk stop > /dev/null 2>&1
54         echo -n "."
55         sleep 2
56         echo -n "."
57         if /etc/init.d/netatalk start > /dev/null 2>&1
58         then
59             echo "done."
60         fi
61     ;;
62   
63     *)
64         echo "Usage: /etc/init.d/netatalk {start|stop|restart|force-reload}" >&2
65         exit 1
66     ;;
67 esac
68