summaryrefslogtreecommitdiff
path: root/mail/archiveopteryx/files/archiveopteryx.in
blob: 620724fe201bd067a41f368aa5dfc66a3d824003 (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
54
55
56
57
58
59
60
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: archiveopteryx
# REQUIRE: login
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# archiveopteryx_enable (bool):	Set to NO by default.
#	Set it to YES to enable archiveopteryx.
#

. /etc/rc.subr

name="archiveopteryx"
rcvar=archiveopteryx_enable

archiveopteryx_enable=${archiveopteryx_enable:-"NO"}
pidfile=/var/run/${name}.pid
config_file=%%PREFIX%%/etc/archiveopteryx/archiveopteryx.conf
required_files=$config_file

command=%%PREFIX%%/bin/aox
extra_commands="status"
status_cmd="do_status"
start_cmd="do_start"
stop_cmd="do_stop"
restart_cmd="do_restart"

do_start()
{
    echo -n "Starting Archiveopteryx: "
    ${command} start
    echo "done."
}

do_stop()
{
    echo -n "Stopping Archiveopteryx: "
    ${command} stop
    echo "done."
}

do_restart()
{
    echo -n "Restarting Archiveopteryx: "
    ${command} restart
    echo "done."
}

do_status()
{
    ${command} show status
}

load_rc_config $name
run_rc_command "$1"