]> git.pld-linux.org Git - packages/netatalk.git/blame - netatalk.init
- cleaning
[packages/netatalk.git] / netatalk.init
CommitLineData
6d921f88 1#! /bin/sh
2# chkconfig: 345 91 35
3# description: This package enables Linux to talk to Macintosh
4# computers via the AppleTalk networking protocol and
5# provides printer, file sharing, and AppleTalk routing
6# services.
7#
8# AppleTalk daemons. Make sure not to start atalkd in the background:
9# its data structures must have time to stablize before running the
10# other processes.
11
12# Source function library.
13. /etc/rc.d/init.d/functions
14
15# Source networking configuration.
16. /etc/sysconfig/network
17
18# Quickly probe for appletalk and warn if we can't find it
19/sbin/modprobe appletalk || echo "[could not load appletalk module]"
20
21# Check for IP Encapsulation support
22#/sbin/modprobe ipddp || echo "[could not load IP encapsulation]"
23
24# read in netatalk configuration
25. /etc/sysconfig/netatalk
26
27# Check that networking is up.
28[ ${NETWORKING} = "no" ] && exit 0
29
30# initialize return values
31RETVAL=1
32RETVAL_ATALKD=0
33RETVAL_PAPD=0
34RETVAL_AFPD=0
35
36# startup code for everything
37case "$1" in
38'start')
39
40 if [ -f /var/lock/subsys/atalk ]; then
41 msg_Already_Running "AppleTalk services"
42 exit 1
43 fi
44
45 if [ x"${ATALKD_RUN}" != x"no" ]; then
46 msg_starting "atalkd"
47 daemon atalkd
48 RETVAL_ATALKD=$?
49 action "Registering ${ATALK_NAME}:Workstation${ATALK_ZONE}:" nbprgstr -p 4 \"${ATALK_NAME}:Workstation${ATALK_ZONE}\"
50 action "Registering ${ATALK_NAME}:netatalk${ATALK_ZONE}:" nbprgstr -p 4 \"${ATALK_NAME}:netatalk${ATALK_ZONE}\"
51 if [ x"${PAPD_RUN}" = x"yes" ]; then
52 msg_starting "papd"
53 daemon papd
54 RETVAL_PAPD=$?
55 fi
56 fi
57
58 if [ x"${TIMELORD_RUN}" = x"yes" ]; then
59 msg_starting "timelord"
60 daemon timelord
61 fi
62
63 if [ x"${AFPD_RUN}" = x"yes" ] ; then
64 msg_starting "afpd"
65 daemon afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} -c ${AFPD_MAX_CLIENTS} -n \"${ATALK_NAME}${ATALK_ZONE}\"
66 RETVAL_AFPD=$?
67 fi
68
69 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then
70 RETVAL=0
71 touch /var/lock/subsys/atalk || RETVAL=1
72 fi
73 ;;
74
75'stop')
76 if [ ! -f /var/lock/subsys/atalk ]; then
77 msg_Not_Running "AppleTalk services"
78 exit 1
79 fi
80
81 if [ x"${ATALKD_RUN}" != x"no" ]; then
82 if [ x"${PAPD_RUN}" = x"yes" ]; then
83 msg_stopping "papd"
84 killproc papd
85 RETVAL_PAPD=$?
86 fi
87
88 if [ x"${TIMELORD_RUN}" = x"yes" ]; then
89 msg_stopping "timelord"
90 killproc timelord
91 fi
92
93 action "Unregistering ${ATALK_NAME}:Workstation${ATALK_ZONE}:" nbpunrgstr \"${ATALK_NAME}:Workstation${ATALK_ZONE}\"
94 action "Unregistering ${ATALK_NAME}:netatalk${ATALK_ZONE}:" nbpunrgstr \"${ATALK_NAME}:netatalk${ATALK_ZONE}\"
95
96 msg_stopping "atalk"
97 killproc atalkd
98 RETVAL_ATALKD=$?
99 fi
100
101 if [ x"${AFPD_RUN}" = x"yes" ]; then
102 msg_stopping "afpd"
103 killproc afpd
104 RETVAL_AFPD=$?
105 fi
106
107 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ] ; then
108 RETVAL=0
109 rm -f /var/lock/subsys/atalk || RETVAL=1
110 fi
111 ;;
112 'restart'|'reload')
113 $0 stop
114 $0 start
115 RETVAL=$?
116 ;;
117 'status')
118 status atalkd
119 RETVAL=$?
120 ;;
121 *)
122 echo "Usage: atalk {start|stop|restart|status}"
123 exit 1
124esac
125
126exit $RETVAL
This page took 0.151251 seconds and 4 git commands to generate.