summaryrefslogtreecommitdiffstats
path: root/www/orion/files/orion.sh
blob: b27dea9f7de59f2b1360422115771839a163b851 (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
#!/bin/sh
# -*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4
#
# %%APP_TITLE%% startup script.
#
# $FreeBSD$
#


# Set some variables
MYSELF=`basename $0`

case "$1" in
	start)
		truncate -s 0 %%PID_FILE%%
		chown %%USER%%:%%GROUP%% %%PID_FILE%%
		chmod 600 %%PID_FILE%%
		su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% start > /dev/null" && echo -n ' %%APP_SHORTNAME%%'
		;;
	stop)
		chown %%USER%%:%%GROUP%% %%PID_FILE%%
		chmod 600 %%PID_FILE%%
		su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% stop > /dev/null" && echo -n ' %%APP_SHORTNAME%%'
		;;
	*)
		echo ""
		echo "Usage: ${MYSELF} { start | stop }"
		echo ""
		exit 64
		;;
esac
OpenPOWER on IntegriCloud