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 # nls "ERROR: Networking is down. %s can't be run." <service>
31 msg_network_down "AppleTalk"
38 # initialize return values
45 if [ -f /var/lock/subsys/atalk ]; then
46 msg_already_running "AppleTalk"
50 if is_yes "${ATALKD_RUN}"; then
54 run_cmd -a "$(nls "Registering %s" "${ATALK_NAME}:Workstation${ATALK_ZONE}:")" "nbprgstr -p 4 \"${ATALK_NAME}:Workstation${ATALK_ZONE}\""
55 run_cmd -a "$(nls "Registering %s" "${ATALK_NAME}:netatalk${ATALK_ZONE}:")" "nbprgstr -p 4 \"${ATALK_NAME}:netatalk${ATALK_ZONE}\""
56 if is_yes "${PAPD_RUN}"; then
63 if is_yes "${TIMELORD_RUN}"; then
64 msg_starting "timelord"
68 if is_yes "${AFPD_RUN}"; then
70 daemon afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} -c ${AFPD_MAX_CLIENTS} -n \"${ATALK_NAME}${ATALK_ZONE}\"
74 if [ "$RETVAL_ATALKD" -eq 0 -a "$RETVAL_PAPD" -eq 0 -a "$RETVAL_AFPD" -eq 0 ]; then
76 touch /var/lock/subsys/atalk || RETVAL=1
81 if [ ! -f /var/lock/subsys/atalk ]; then
82 msg_not_running "AppleTalk"
86 if is_yes "${ATALKD_RUN}"; then
87 if is_yes "${PAPD_RUN}"; then
92 if is_yes "${TIMELORD_RUN}"; then
93 msg_stopping "timelord"
97 run_cmd "$(nls "Unregistering %s" "${ATALK_NAME}:Workstation${ATALK_ZONE}:")" "nbpunrgstr \"${ATALK_NAME}:Workstation${ATALK_ZONE}\""
98 run_cmd "$(nls "Unregistering %s" "${ATALK_NAME}:netatalk${ATALK_ZONE}:")" "nbpunrgstr \"${ATALK_NAME}:netatalk${ATALK_ZONE}\""
104 if is_yes "${AFPD_RUN}"; then
108 rm -f /var/lock/subsys/atalk >/dev/null 2>&1
112 # startup code for everything
121 restart|force-reload)
126 if is_yes "${ATALKD_RUN}"; then
127 if is_yes "${PAPD_RUN}"; then
131 if is_yes "${TIMELORD_RUN}"; then
135 if is_yes "${AFPD_RUN}"; then
139 nbplkup ${ATALK_NAME}
144 msg_usage "$0 {start|stop|restart|force-reload|status}"