aboutsummaryrefslogtreecommitdiffstats
path: root/net/netatalk/files/netatalk.sh
blob: e1f7a1690b8d7c69fee6e29377352c784768ecbf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/net/netatalk/files/Attic/netatalk.sh,v 1.5 2006-01-08 21:50:27 marcus Exp $
#
# PROVIDE: atalkd papd cnid_metad afpd timelord
# REQUIRE: DAEMON %%SRVLOC%%
# KEYWORD: shutdown
#
# AppleTalk daemons. Make sure not to start atalkd in the background:
# its data structures must have time to stablize before running the
# other processes.
#

netatalk_enable=${netatalk_enable-"NO"}
atalkd_enable=${atalkd_enable-"NO"}
papd_enable=${papd_enable-"NO"}
cnid_metad_enable=${cnid_metad_enable-"NO"}
afpd_enable=${afpd_enable-"NO"}
timelord_enable=${timelord_enable-"NO"}

. %%RC_SUBR%%

name=netatalk
rcvar=`set_rcvar`
hostname=`hostname -s`

start_cmd=netatalk_start
stop_cmd=netatalk_stop

netatalk_start() {
    checkyesno atalkd_enable && %%PREFIX%%/sbin/atalkd
    checkyesno atalkd_enable && \
        %%PREFIX%%/bin/nbprgstr -p 4 ${hostname}:Workstation &
    checkyesno atalkd_enable && \
        %%PREFIX%%/bin/nbprgstr -p 4 ${hostname}:netatalk &
    checkyesno papd_enable && %%PREFIX%%/sbin/papd
    checkyesno cnid_metad_enable && %%PREFIX%%/sbin/cnid_metad
    checkyesno afpd_enable && \
        %%PREFIX%%/sbin/afpd -s %%PREFIX%%/etc/AppleVolumes.system \
    -f %%PREFIX%%/etc/AppleVolumes.default
    checkyesno timelord_enable && %%PREFIX%%/sbin/timelord
}

netatalk_stop() {
    checkyesno timelord_enable && killall timelord
    checkyesno afpd_enable && killall afpd
    checkyesno cnid_metad_enable && killall cnid_metad
    checkyesno papd_enable && killall papd
    checkyesno atalkd_enable && killall atalkd
}

load_rc_config ${name}
run_rc_command "$1"