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
53 # startup code for everything
55 if [ x"${ATALKD_RUN}" != x"no" ]; then
56 daemon /usr/sbin/atalkd
59 if [ -x /usr/bin/nbprgstr ]; then
60 /usr/bin/nbprgstr -p 4 "${ATALK_NAME}:Workstation${ATALK_ZONE}"
61 /usr/bin/nbprgstr -p 4 "${ATALK_NAME}:netatalk${ATALK_ZONE}"
64 if [ x"${PAPD_RUN}" = x"yes" -a -x /usr/sbin/papd ]; then
69 if [ -x /usr/sbin/timelord ]; then
70 daemon /usr/sbin/timelord
74 if [ x"${AFPD_RUN}" = x"yes" -a -x /usr/sbin/afpd ] ; then
75 daemon /usr/sbin/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
76 -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}"
80 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then
82 touch /var/lock/subsys/atalk || RETVAL=1
88 LINE1=`$GETMSG $START_MSG1`
89 LINE2=`$GETMSG $START_MSG2`
91 $LCD_SWRITE "$LINE1" "$LINE2" &>/dev/null &
92 echo -n 'Starting AppleTalk services: '
93 if [ x"${ATALK_BGROUND}" = x"yes" ]; then
94 echo -n "(backgrounded)"
95 atalk_startup >& /dev/null &
100 touch /var/lock/subsys/atalk
103 LINE1=`$GETMSG $STOP_MSG1`
104 LINE2=`$GETMSG $STOP_MSG2`
106 $LCD_SWRITE "$LINE1" "$LINE2" &>/dev/null &
107 echo -n 'Shutting down AppleTalk services: '
108 if [ x"${ATALKD_RUN}" != x"no" ]; then
109 if [ x"${PAPD_RUN}" = x"yes" -a -x /usr/sbin/papd ]; then
114 /usr/bin/nbpunrgstr "${ATALK_NAME}:Workstation${ATALK_ZONE}"
115 /usr/bin/nbpunrgstr "${ATALK_NAME}:netatalk${ATALK_ZONE}"
117 # kill atalkd last, since without it the plumbing goes away.
118 if [ -x /usr/sbin/atalkd ]; then
124 # kill this separately as we also do AFP/tcp
125 if [ x"${AFPD_RUN}" = x"yes" -a -x /usr/sbin/afpd ]; then
130 if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ] ; then
132 rm -f /var/lock/subsys/atalk || RETVAL=1
144 echo "Usage: atalk {start|stop|restart|status}"