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
12 # Source function library.
13 . /etc/rc.d/init.d/functions
15 # Source networking configuration.
16 . /etc/sysconfig/network
18 test -x :SBINDIR:/atalkd || exit 0
20 test -f :ETCDIR:/netatalk.conf || exit 0
22 # read in netatalk configuration
23 . :ETCDIR:/netatalk.conf
25 # Check that networking is up.
26 [ ${NETWORKING} = "no" ] && exit 0
28 # initialize return values
34 # startup code for everything
36 if [ x"${ATALKD_RUN}" != x"no" ]; then
37 daemon :SBINDIR:/atalkd
40 if [ -x :BINDIR:/nbprgstr ]; then
41 :BINDIR:/nbprgstr -p 4 "${ATALK_NAME}:Workstation${ATALK_ZONE}"
42 :BINDIR:/nbprgstr -p 4 "${ATALK_NAME}:netatalk${ATALK_ZONE}"
45 if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then
50 # check for timelord in bin directory
51 if [ -x :BINDIR:/timelord ]; then
52 daemon :BINDIR:/timelord
55 # check for timelord in sbin directory
56 if [ -x :SBINDIR:/timelord ]; then
57 daemon :SBINDIR:/timelord
62 if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ] ; then
63 daemon :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
64 -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}"
68 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then
70 touch /var/lock/subsys/atalk || RETVAL=1
76 echo -n 'Starting AppleTalk services: '
77 if [ x"${ATALK_BGROUND}" = x"yes" ]; then
78 echo -n "(backgrounded)"
79 atalk_startup >& /dev/null &
86 echo -n 'Shutting down AppleTalk services: '
87 if [ x"${ATALKD_RUN}" != x"no" ]; then
88 if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then
93 # checking for timelord in bin directory
94 if [ -x :BINDIR:/timelord ]; then
98 # checking for timelord in sbin directory
99 if [ -x :SBINDIR:/timelord ]; then
103 :BINDIR:/nbpunrgstr "${ATALK_NAME}:Workstation${ATALK_ZONE}"
104 :BINDIR:/nbpunrgstr "${ATALK_NAME}:netatalk${ATALK_ZONE}"
106 # kill atalkd last, since without it the plumbing goes away.
107 if [ -x :SBINDIR:/atalkd ]; then
113 # kill this separately as we also do AFP/tcp
114 if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ]; then
119 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ] ; then
121 rm -f /var/lock/subsys/atalk || RETVAL=1
135 echo "Usage: atalk {start|stop|restart|status}"