aboutsummaryrefslogtreecommitdiffstats
path: root/turff/turff_launcher
blob: 0df0594b6d8dfdaf6068b84d778ec371dfc727d1 (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
#!/usr/bin/env bash

help () {
	echo -e "\nThis is a wrapper for launching TURFF"
	echo -e "usage: $0 -f env_config_file\n";
	echo "Options:"
	echo -e "-f cross compiler environment configuration file"
	echo -e "-h show this help menu"
	exit 1;
}

SUPERVISE=supervise
EXEC=/bin/turff/

while getopts ":hf:" opt; do
	case $opt in
		f)
			env_conf_file=$OPTARG
			;;
		h)
			help
			exit 1
			;;
		\?)
			echo "Invalid option: -$OPTARG"
			exit 1
			;;
		:)
			echo "Option -$OPTARG requires an argument."
			exit 1
			;;
	esac
done

if [ -n "$env_conf_file" ]; then
	source $env_conf_file
fi

if [ $? -eq 0 ] ; then
	$SUPERVISE $EXEC
else
	echo "Error setting up cross compiler environment"
fi