]> arthur.barton.de Git - netatalk.git/blob - distrib/initscripts/rc.atalk.gentoo.tmpl
Naming issues. From HAT.
[netatalk.git] / distrib / initscripts / rc.atalk.gentoo.tmpl
1 #!/sbin/runscript
2
3 # Netatalk daemons.
4 # If you use AppleTalk, Make sure not to start atalkd in the background:
5 # its data structures must have time to stablize before running the
6 # other processes.
7
8 depend() {
9         need net
10         use logger dns
11 }
12
13 atalk_startup () {
14 #       . :ETCDIR:/netatalk.conf
15
16         if [ "${ATALKD_RUN}" != "no" ]; then
17                 ebegin "Starting atalkd"
18                 start-stop-daemon --start --quiet --exec :SBINDIR:/atalkd
19                 eend $?
20
21                 for reg in \
22                         "${ATALK_NAME}:Workstation${ATALK_ZONE}" \
23                         "${ATALK_NAME}:netatalk${ATALK_ZONE}"
24                 do
25                         ebegin "  Registering $reg"
26                         :BINDIR:/nbprgstr "$reg"
27                         eend $?
28                 done
29
30                 if [ "${PAPD_RUN}" = "yes" ]; then
31                         ebegin "  Starting papd"
32                         start-stop-daemon --start --quiet --exec :SBINDIR:/papd
33                         eend $?
34                 fi
35
36         fi
37
38         if [ "${CNID_METAD_RUN}" = "yes" ] ; then
39         ebegin "Starting cnid_metad"
40                 start-stop-daemon --start --quiet --exec :SBINDIR:/cnid_metad $CNID_CONFIG
41                 eend $?
42         fi
43
44
45         if [ "${AFPD_RUN}" = "yes" ]; then
46                 ebegin "Starting afpd"
47                 start-stop-daemon --start --quiet --exec :SBINDIR:/afpd -- \
48                         ${AFPD_UAMLIST} -g ${AFPD_GUEST} -c ${AFPD_MAX_CLIENTS} \
49                         -n "${ATALK_NAME}${ATALK_ZONE}"
50                 eend $?
51         fi
52
53         if [ "${TIMELORD_RUN}" = "yes" ]; then
54                 ebegin "Starting timelord"
55                 start-stop-daemon --start --quiet --exec :SBINDIR:/timelord
56                 eend $?
57         fi
58 }
59
60 start () {
61         . :ETCDIR:/netatalk.conf
62
63         if [ x"${ATALK_BGROUND}" = x"yes" ]; then
64             echo "Starting netatalk in the background ... "
65             atalk_startup >& /dev/null &
66         else
67             atalk_startup
68         fi
69 }
70
71 stop () {
72         . :ETCDIR:/netatalk.conf
73
74         if [ "${AFPD_RUN}" = "yes" ]; then
75                 ebegin "Stopping afpd"
76                 start-stop-daemon --stop --quiet --exec :SBINDIR:/afpd
77                 eend $?
78         fi
79
80         if [ "${TIMELORD_RUN}" = "yes" ]; then
81                 ebegin "Stopping timelord"
82                 start-stop-daemon --stop --quiet --exec :SBINDIR:/timelord
83                 eend $?
84         fi
85
86         if [ "${ATALKD_RUN}" != "no" ]; then
87                 if [ "${PAPD_RUN}" = "yes" ]; then
88                         ebegin "Stopping papd"
89                         start-stop-daemon --stop --quiet --exec :SBINDIR:/papd
90                         eend $?
91                 fi
92
93                 for reg in \
94                         "${ATALK_NAME}:Workstation${ATALK_ZONE}" \
95                         "${ATALK_NAME}:netatalk${ATALK_ZONE}"
96                 do
97                         ebegin "Unregistering $reg"
98                         :BINDIR:/nbpunrgstr "$reg"
99                         eend $?
100                 done
101
102                 ebegin "Stopping atalkd"
103                 start-stop-daemon --stop --quiet --exec :SBINDIR:/atalkd
104                 eend $?
105         fi
106
107         if [ "${CNID_METAD_RUN}" = "yes" ] ; then
108                 ebegin "Stopping cnid_metad"
109                 start-stop-daemon --stop --quiet --exec :SBINDIR:/cnid_metad
110                 eend $?
111         fi
112 }