4 # description: Starts and stops the atalk, afpd & papd daemons for
5 # providing AppleTalk networking services.
8 # Source function library.
9 . /etc/rc.d/init.d/functions
11 # set lcd stuff up if necessary
12 if [ x"$LCD_STOP" = x"" ]; then
13 LCD_STOP="/sbin/stoplcd"
15 if [ x"$LCD_SWRITE" = x"" ]; then
16 LCD_SWRITE="/sbin/swritelcd"
19 # set up i18n stuff if necessary
20 if [ -x /usr/local/sbin/getmsg ]; then
21 GETMSG=/usr/local/sbin/getmsg
22 START_MSG1=atalkStart1
23 START_MSG2=atalkStart2
28 START_MSG1=atalk_start_1
29 START_MSG2=atalk_start_2
30 STOP_MSG1=atalk_stop_1
31 STOP_MSG2=atalk_stop_2
34 # Source networking configuration.
35 . /etc/sysconfig/network
37 test -x /usr/sbin/atalkd || exit 0
39 test -f /etc/atalk/netatalk.conf || exit 0
41 # read in netatalk configuration
42 . /etc/atalk/netatalk.conf
44 # Check that networking is up.
45 [ ${NETWORKING} = "no" ] && exit 0
47 # initialize return values
54 # startup code for everything
56 if [ x"${ATALKD_RUN}" != x"no" ]; then
57 daemon /usr/sbin/atalkd
60 if [ -x /usr/bin/nbprgstr ]; then
61 /usr/bin/nbprgstr -p 4 "${ATALK_NAME}:Workstation${ATALK_ZONE}"
62 /usr/bin/nbprgstr -p 4 "${ATALK_NAME}:netatalk${ATALK_ZONE}"
65 if [ x"${PAPD_RUN}" = x"yes" -a -x /usr/sbin/papd ]; then
70 if [ -x /usr/sbin/timelord ]; then
71 daemon /usr/sbin/timelord
75 if [ x"${CNID_METAD_RUN}" = x"yes" -a -x /usr/sbin/cnid_metad ] ; then
76 daemon /usr/sbin/cnid_metad $CNID_CONFIG
80 if [ x"${AFPD_RUN}" = x"yes" -a -x /usr/sbin/afpd ] ; then
81 daemon /usr/sbin/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
82 -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}"
86 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_CNID_METAD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then
88 touch /var/lock/subsys/atalk || RETVAL=1
94 LINE1=`$GETMSG $START_MSG1`
95 LINE2=`$GETMSG $START_MSG2`
97 $LCD_SWRITE "$LINE1" "$LINE2" &>/dev/null &
98 echo -n 'Starting AppleTalk services: '
99 if [ x"${ATALK_BGROUND}" = x"yes" ]; then
100 echo -n "(backgrounded)"
101 atalk_startup >& /dev/null &
106 touch /var/lock/subsys/atalk
109 LINE1=`$GETMSG $STOP_MSG1`
110 LINE2=`$GETMSG $STOP_MSG2`
112 $LCD_SWRITE "$LINE1" "$LINE2" &>/dev/null &
113 echo -n 'Shutting down AppleTalk services: '
114 if [ x"${ATALKD_RUN}" != x"no" ]; then
115 if [ x"${PAPD_RUN}" = x"yes" -a -x /usr/sbin/papd ]; then
120 /usr/bin/nbpunrgstr "${ATALK_NAME}:Workstation${ATALK_ZONE}"
121 /usr/bin/nbpunrgstr "${ATALK_NAME}:netatalk${ATALK_ZONE}"
123 # kill atalkd last, since without it the plumbing goes away.
124 if [ -x /usr/sbin/atalkd ]; then
130 # kill this separately as we also do AFP/tcp
131 if [ x"${AFPD_RUN}" = x"yes" -a -x /usr/sbin/afpd ]; then
136 if [ x"${CNID_METAD_RUN}" = x"yes" -a -x /usr/sbin/cnid_metad ]; then
141 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_CNID_METAD -eq 0 -a $RETVAL_AFPD -eq 0 ] ; then
143 rm -f /var/lock/subsys/atalk || RETVAL=1
155 echo "Usage: atalk {start|stop|restart|status}"