3 # Start/stop the Netatalk daemons.
6 # If you use AppleTalk, Make sure not to start atalkd in the background:
7 # its data structures must have time to stablize before running the
12 ATALK_CONF_DIR=:ETCDIR:
16 ATALK_START_NBPRGSTR=0
18 ATALK_START_CNID_METAD=1
20 ATALK_START_TIMELORD=0
23 # kill the named process(es)
28 /usr/bin/grep -v grep |
29 /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
30 [ "$pid" != "" ] && kill $pid
36 # Start the netatalk server processes.
41 echo 'starting netatalk daemons: \c'
42 if [ ${ATALK_START_ATALKD} -eq 1 -a -x ${ATALK_SBIN}/atalkd ]; then
43 ${ATALK_SBIN}/atalkd; echo ' atalkd\c'
46 if [ ${ATALK_START_NBPRGSTR} -eq 1 -a -x ${ATALK_BIN}/nbprgstr ]; then
47 ${ATALK_BIN}/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:Workstation
48 ${ATALK_BIN}/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk
52 if [ ${ATALK_START_PAPD} -eq 1 -a -x ${ATALK_SBIN}/papd ]; then
53 ${ATALK_SBIN}/papd; echo ' papd\c'
56 if [ ${ATALK_START_CNID_METAD} -eq 1 -a -x ${ATALK_SBIN}/cnid_metad ]; then
57 ${ATALK_SBIN}/cnid_metad; echo ' cnid_metad\c'
60 if [ ${ATALK_START_AFPD} -eq 1 -a -x ${ATALK_SBIN}/afpd ]; then
61 ${ATALK_SBIN}/afpd; echo ' afpd\c'
64 if [ ${ATALK_START_TIMELORD} -eq 1 -a -x ${ATALK_SBIN}/timelord ]; then
65 ${ATALK_SBIN}/timelord; echo ' timelord\c'
73 # Stop the netatalk server processes.
78 echo 'stopping netatalk daemons:\c'
80 if [ -x ${ATALK_SBIN}/papd ]; then
81 killproc papd; echo ' papd\c'
84 if [ -x ${ATALK_SBIN}/afpd ]; then
85 killproc afpd; echo ' afpd\c'
88 if [ -x ${ATALK_SBIN}/cnid_metad ]; then
89 killproc cnid_metad; echo ' cnid_metad\c'
92 if [ -x ${ATALK_SBIN}/timelord ]; then
93 killproc timelord; echo ' timelord\c'
96 # kill atalkd last, since without it the plumbing goes away.
97 if [ -x ${ATALK_SBIN}/atalkd ]; then
98 killproc atalkd; echo ' atalkd\c'
109 echo "usage: $0 {start|stop}"