summaryrefslogtreecommitdiff
blob: 8dc86ce342d3c90487f5a38c964aac3ddd1b3391 (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
#!/sbin/runscript
#This was heavily copied from the generic-init.d script which comes with the
#binary version of firebird-ss

depend() {
	need net
}

check_config() {
	[ -z $INTERBASE ] && return 0
	[ -z $ISC_USER ] && return 0
	[ -z $ISC_PASSWORD ] && return 0
	[ -x $INTERBASE/bin/ibmgr ] || return 0
}

# See how we were called.
start() {
	check_config || return 1
	ebegin "Starting Firebird server"
	(sudo -u firebird ${INTERBASE}/bin/ibmgr -start -forever -user ${ISC_USER} -password ${ISC_PASSWORD};echo 1>&2) 2>${TEMP}/ibresult
	result="$(cat ${TEMP}/ibresult)"
	rm -f ${TEMP}/ibresult
	if [ "${result/success}" != "${result}" ]; then
		eend 0
	else
		eend 1
	fi
}
stop() {
	check_config || return 1
	ebegin "Stopping Firebird server"
	result="$(sudo -u firebird ${INTERBASE}/bin/ibmgr -shut -user ${ISC_USER} -password ${ISC_PASSWORD} 2>&1)"
	if [ "${result/completed}" != "${result}" ]; then
		eend 0
	else
		eend 1
	fi
}