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 # Quickly probe for appletalk and warn if we can't find it
19 /sbin/modprobe appletalk || echo "[could not load appletalk module]"
21 # Check for IP Encapsulation support
22 #/sbin/modprobe ipddp || echo "[could not load IP encapsulation]"
24 # read in netatalk configuration
25 . /etc/sysconfig/netatalk
27 # Check that networking is up.
28 if is_yes "${NETWORKING}"; then
29 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
30 msg_network_down "AppleTalk"
37 # initialize return values
43 # startup code for everything
46 if [ -f /var/lock/subsys/atalk ]; then
47 msg_already_running "AppleTalk"
51 if is_yes "${ATALKD_RUN}"; then
55 run_cmd -a "$(nls "Registering %s" "${ATALK_NAME}:Workstation${ATALK_ZONE}:")" "nbprgstr -p 4 \"${ATALK_NAME}:Workstation${ATALK_ZONE}\""
56 run_cmd -a "$(nls "Registering %s" "${ATALK_NAME}:netatalk${ATALK_ZONE}:")" "nbprgstr -p 4 \"${ATALK_NAME}:netatalk${ATALK_ZONE}\""
57 if is_yes "${PAPD_RUN}"; then
64 if is_yes "${TIMELORD_RUN}"; then
65 msg_starting "timelord"
69 if is_yes "${AFPD_RUN}"; then
71 daemon afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} -c ${AFPD_MAX_CLIENTS} -n \"${ATALK_NAME}${ATALK_ZONE}\"
75 if [ "$RETVAL_ATALKD" -eq 0 -a "$RETVAL_PAPD" -eq 0 -a "$RETVAL_AFPD" -eq 0 ]; then
77 touch /var/lock/subsys/atalk || RETVAL=1
82 if [ ! -f /var/lock/subsys/atalk ]; then
83 msg_not_running "AppleTalk"
87 if is_yes "${ATALKD_RUN}"; then
88 if is_yes "${PAPD_RUN}"; then
93 if is_yes "${TIMELORD_RUN}"; then
94 msg_stopping "timelord"
98 run_cmd "$(nls "Unregistering %s" "${ATALK_NAME}:Workstation${ATALK_ZONE}:")" "nbpunrgstr \"${ATALK_NAME}:Workstation${ATALK_ZONE}\""
99 run_cmd "$(nls "Unregistering %s" "${ATALK_NAME}:netatalk${ATALK_ZONE}:")" "nbpunrgstr \"${ATALK_NAME}:netatalk${ATALK_ZONE}\""
105 if is_yes "${AFPD_RUN}"; then
111 rm -f /var/lock/subsys/atalk >/dev/null 2>&1
113 restart|force-reload)
119 if is_yes "${ATALKD_RUN}"; then
120 if is_yes "${PAPD_RUN}"; then
124 if is_yes "${TIMELORD_RUN}"; then
128 if is_yes "${AFPD_RUN}"; then
132 nbplkup ${ATALK_NAME}
137 msg_usage "$0 {start|stop|restart|force-reload|status}"