]> arthur.barton.de Git - netatalk.git/blob - distrib/initscripts/rc.atalk.redhat-systemd.tmpl
Fixes, from Mark Williams
[netatalk.git] / distrib / initscripts / rc.atalk.redhat-systemd.tmpl
1 #!/bin/sh
2
3 # Netatalk :NETATALK_VERSION: startup script for systemd.
4
5 # The method of using this script is not suitable.
6 # This script will be deleted in the future.
7
8 ATALK_BIN=:BINDIR:
9 ATALK_CONF_DIR=:ETCDIR:
10 ATALK_SBIN=:SBINDIR:
11
12 # default
13 ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1`
14 ATALK_UNIX_CHARSET='LOCALE'
15 ATALK_MAC_CHARSET='MAC_ROMAN'
16
17 CNID_METAD_RUN=yes
18 AFPD_RUN=yes
19 AFPD_MAX_CLIENTS=20
20 AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so"
21 AFPD_GUEST=nobody
22 CNID_CONFIG="-l log_note"
23
24 ATALKD_RUN=no
25 PAPD_RUN=no
26 TIMELORD_RUN=no
27 A2BOOT_RUN=no
28 ATALK_ZONE=
29 ATALK_BGROUND=no
30
31 # read in netatalk configuration
32 if [ -f ${ATALK_CONF_DIR}/netatalk.conf ]; then
33     . ${ATALK_CONF_DIR}/netatalk.conf
34 fi
35
36 netatalk_startup() {
37     if [ x"${ATALKD_RUN}" != x"no" -a -x ${ATALK_SBIN}/atalkd ]; then
38         ${ATALK_SBIN}/atalkd
39         
40         if [ -x ${ATALK_BIN}/nbprgstr ]; then
41             ${ATALK_BIN}/nbprgstr -p 4 ${ATALK_NAME}:Workstation${ATALK_ZONE}
42             ${ATALK_BIN}/nbprgstr -p 4 ${ATALK_NAME}:netatalk${ATALK_ZONE}
43         fi      
44         
45         if [ x"${PAPD_RUN}" = x"yes"  -a -x ${ATALK_SBIN}/papd ]; then
46             ${ATALK_SBIN}/papd
47         fi
48         
49         # check for timelord in bin directory
50         if [ x"${TIMELORD_RUN}" = x"yes"  -a -x ${ATALK_BIN}/timelord ]; then
51             ${ATALK_BIN}/timelord
52         fi
53         
54         # check for timelord in sbin directory
55         if [ x"${TIMELORD_RUN}" = x"yes"  -a -x ${ATALK_SBIN}/timelord ]; then
56             ${ATALK_SBIN}/timelord
57         fi
58         
59         # check for a2boot in bin directory
60         if [ x"${A2BOOT_RUN}" = x"yes"  -a -x ${ATALK_BIN}/a2boot ]; then
61             ${ATALK_BIN}/a2boot
62         fi
63         
64         # check for a2boot in sbin directory
65         if [ x"${A2BOOT_RUN}" = x"yes"  -a -x ${ATALK_SBIN}/a2boot ]; then
66             ${ATALK_SBIN}/a2boot
67         fi
68     fi
69     
70     if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ]; then
71         ${ATALK_SBIN}/cnid_metad $CNID_CONFIG
72     fi
73     
74     if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ]; then
75         ${ATALK_SBIN}/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
76             -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
77     fi
78 }
79
80 if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then 
81     netatalk_startup >& /dev/null &
82 else
83     netatalk_startup
84 fi