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 test -x ${ATALK_SBIN}/atalkd || exit 0
24 test -f ${ATALK_CONF_DIR}/netatalk.conf || exit 0
26 # read in netatalk configuration
27 . ${ATALK_CONF_DIR}/netatalk.conf
29 # Check that networking is up.
30 [ ${NETWORKING} = "no" ] && exit 0
32 # initialize return values
38 # startup code for everything
40 if [ x"${ATALKD_RUN}" != x"no" ]; then
41 daemon ${ATALK_SBIN}/atalkd
44 if [ -x ${ATALK_BIN}/nbprgstr ]; then
45 ${ATALK_BIN}/nbprgstr -p 4 "${ATALK_NAME}:Workstation${ATALK_ZONE}"
46 ${ATALK_BIN}/nbprgstr -p 4 "${ATALK_NAME}:netatalk${ATALK_ZONE}"
49 if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then
50 daemon ${ATALK_SBIN}/papd
54 # check for timelord in bin directory
55 if [ -x ${ATALK_BIN}/timelord ]; then
56 daemon ${ATALK_BIN}/timelord
59 # check for timelord in sbin directory
60 if [ -x ${ATALK_SBIN}/timelord ]; then
61 daemon ${ATALK_SBIN}/timelord
66 if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ] ; then
67 daemon ${ATALK_SBIN}/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
68 -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}"
72 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then
74 touch /var/lock/subsys/atalk || RETVAL=1
80 echo -n 'Starting AppleTalk services: '
81 if [ x"${ATALK_BGROUND}" = x"yes" ]; then
82 echo -n "(backgrounded)"
83 atalk_startup >& /dev/null &
90 echo -n 'Shutting down AppleTalk services: '
91 if [ x"${ATALKD_RUN}" != x"no" ]; then
92 if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then
97 # checking for timelord in bin directory
98 if [ -x ${ATALK_BIN}/timelord ]; then
102 # checking for timelord in sbin directory
103 if [ -x ${ATALK_SBIN}/timelord ]; then
107 ${ATALK_BIN}/nbpunrgstr "${ATALK_NAME}:Workstation${ATALK_ZONE}"
108 ${ATALK_BIN}/nbpunrgstr "${ATALK_NAME}:netatalk${ATALK_ZONE}"
110 # kill atalkd last, since without it the plumbing goes away.
111 if [ -x ${ATALK_SBIN}/atalkd ]; then
117 # kill this separately as we also do AFP/tcp
118 if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ]; then
123 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ] ; then
125 rm -f /var/lock/subsys/atalk || RETVAL=1
139 echo "Usage: atalk {start|stop|restart|status}"