summaryrefslogtreecommitdiff
blob: 8d3d9c475a94c1dfa2d74884dd15be7b148f6879 (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/sbin/runscript

groupware="/etc/open-xchange/init.d/groupware"
webmail="/etc/open-xchange/init.d/webmail"
sessiond="/etc/open-xchange/init.d/sessiond"

depend() {
	need net slapd apache2 tomcat-5
	use postgresql mysql cyrus courier-imapd courier-imapd-ssl postfix
	after postgresql mysql
}

checkconfig() {
	if [[ ! -x ${groupware} ]] ; then
		eerror "${groupware} doesn't exist or nor executable"
		return 1
	fi
	if [[ ! -x ${webmail} ]] ; then
		eerror "${webmail} doesn't exist or nor executable"
		return 1
	fi	
	if [[ ! -x ${sessiond} ]] ; then
		eerror "${sessiond} doesn't exist or nor executable"
		return 1
	fi
}


start() {
	checkconfig || return 1

	local retval

	ebegin "Starting Open-Xchange sessiond"
	start-stop-daemon --start --exec ${sessiond} -- start &> /dev/null
	retval=$?
	eend $retval
	[[ ${retval} -eq 0 ]] || return 1

	ebegin "Starting Open-Xchange groupware"
	start-stop-daemon --start --exec ${groupware} -- start &> /dev/null
	retval=$?
	eend $retval
	[[ ${retval} -eq 0 ]] || return 1

	ebegin "Starting Open-Xchange webmail"
	start-stop-daemon --start --exec ${webmail} -- start &> /dev/null
	retval=$?
	eend $retval
	[[ ${retval} -eq 0 ]] || return 1
}

stop() {
	local retval

	ebegin "Stopping Open-Xchange sessiond"
	start-stop-daemon --start --exec ${sessiond} -- stop &> /dev/null
	retval=$?
	eend $retval
	[[ ${retval} -eq 0 ]] || return 1

	ebegin "Stopping Open-Xchange groupware"
	start-stop-daemon --start --exec ${groupware} -- stop &> /dev/null
	retval=$?
	eend $retval
	[[ ${retval} -eq 0 ]] || return 1

	ebegin "Stopping Open-Xchange webmail"
	start-stop-daemon --start --exec ${webmail} -- stop &> /dev/null
	retval=$?
	eend $retval
	[[ ${retval} -eq 0 ]] || return 1
}

opts="${opts} extendstatus"

extendstatus() {
	status="$sessiond status"
	$status
	status="$groupware status"
	$status
	stop="$webmail status"
	$status
}