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
8 # AppleTalk daemons. Make sure not to start atalkd in the background:
9 # its data structures must have time to stablize before running the
13 ATALK_CONF_DIR=:ETCDIR:
16 # Source function library.
17 . /etc/rc.d/init.d/functions
19 # Source networking configuration.
20 . /etc/sysconfig/network
22 # Quickly probe for appletalk and warn if we can't find it
23 /sbin/modprobe appletalk || echo "[could not load appletalk module]"
25 # Check for IP Encapsulation support
26 #/sbin/modprobe ipddp || echo "[could not load IP encapsulation]"
28 test -x ${ATALK_SBIN}/atalkd || exit 0
30 test -f ${ATALK_CONF_DIR}/netatalk.conf || exit 0
32 # read in netatalk configuration
33 . ${ATALK_CONF_DIR}/netatalk.conf
35 # Check that networking is up.
36 [ ${NETWORKING} = "no" ] && exit 0
38 # initialize return values
44 # startup code for everything
46 if [ x"${ATALKD_RUN}" != x"no" ]; then
47 echo -n " Starting atalkd:"
48 daemon ${ATALK_SBIN}/atalkd
52 if [ -x ${ATALK_BIN}/nbprgstr ]; then
53 action " Registering ${ATALK_NAME}:Workstation${ATALK_ZONE}:" ${ATALK_BIN}/nbprgstr -p 4 \"${ATALK_NAME}:Workstation${ATALK_ZONE}\"
54 action " Registering ${ATALK_NAME}:netatalk${ATALK_ZONE}:" ${ATALK_BIN}/nbprgstr -p 4 \"${ATALK_NAME}:netatalk${ATALK_ZONE}\"
57 if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then
58 echo -n " Starting papd:"
59 daemon ${ATALK_SBIN}/papd
64 # check for timelord in bin directory
65 if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_BIN}/timelord ]; then
66 echo -n " Starting timelord"
67 daemon ${ATALK_BIN}/timelord
71 # check for timelord in sbin directory
72 if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/timelord ]; then
73 echo -n " Starting timelord"
74 daemon ${ATALK_SBIN}/timelord
80 if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ] ; then
81 echo -n " Starting afpd:"
82 daemon ${ATALK_SBIN}/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
83 -c ${AFPD_MAX_CLIENTS} -n \"${ATALK_NAME}${ATALK_ZONE}\"
88 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then
90 touch /var/lock/subsys/atalk || RETVAL=1
96 echo -n 'Starting AppleTalk services: '
97 if [ x"${ATALK_BGROUND}" = x"yes" ]; then
98 echo -n "(backgrounded)"
99 atalk_startup >& /dev/null &
107 echo 'Shutting down AppleTalk services: '
108 if [ x"${ATALKD_RUN}" != x"no" ]; then
109 if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then
110 echo -n " Stopping papd:"
116 # checking for timelord in bin directory
117 if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_BIN}/timelord ]; then
118 echo -n " Stopping timelord:"
123 # checking for timelord in sbin directory
124 if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/timelord ]; then
125 echo -n " Stopping timelord:"
130 action " Unregistering ${ATALK_NAME}:Workstation${ATALK_ZONE}:" ${ATALK_BIN}/nbpunrgstr \"${ATALK_NAME}:Workstation${ATALK_ZONE}\"
131 action " Unregistering ${ATALK_NAME}:netatalk${ATALK_ZONE}:" ${ATALK_BIN}/nbpunrgstr \"${ATALK_NAME}:netatalk${ATALK_ZONE}\"
133 # kill atalkd last, since without it the plumbing goes away.
134 if [ -x ${ATALK_SBIN}/atalkd ]; then
135 echo -n " Stopping atalk:"
142 # kill this separately as we also do AFP/tcp
143 if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ]; then
144 echo -n " Stopping afpd:"
150 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ] ; then
152 rm -f /var/lock/subsys/atalk || RETVAL=1
166 echo "Usage: atalk {start|stop|restart|status}"