summaryrefslogtreecommitdiff
blob: 354cc424f97ffd4f206628217cf3cb438f52613a (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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() { 
	need net
}

checkconfig() {
	if [ ! -e "${GIMPS_DIR}" ]; then
		einfo "Creating ${GIMPS_DIR}"
		/bin/mkdir "${GIMPS_DIR}"
	fi

	/bin/chown ${USER}:${GROUP} ${GIMPS_DIR}
	/bin/chown ${USER}:${GROUP} ${GIMPS_DIR}/*
}

start() {
	checkconfig
	ebegin "Starting GIMPS"
	start-stop-daemon --quiet --start --exec /opt/gimps/mprime \
			--chdir ${GIMPS_DIR} --chuid ${USER}:${GROUP} \
			-- -b${GIMPS_CPUS} -w${GIMPS_DIR} ${GIMPS_OPTIONS}
	eend $?
}

stop() {
	ebegin "Stopping GIMPS"
	start-stop-daemon --quiet --stop --exec /opt/gimps/mprime
	eend $?
}