-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjam
executable file
·57 lines (46 loc) · 996 Bytes
/
jam
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
#!/bin/bash
die() {
printf '%s\n' "$1" >&2
exit 1
}
show_usage() {
cat << EOF
Runs a collection of jam machine commands.
jam help - prints this help
jam clean - clean the setup left behind by old runs
jam close - close all terminaled opened by the 'term' command
jam install - install the JAMScript from source.
jam kill - kill a node
jam list - lists all the JAMScript programs running in the system
jam run - start a device, fog, or cloud
jam term - show the tmux terminals of the running nodes
Type 'jam cmd --help' for more help on the specific command.
EOF
}
if [ -z $1 ] || [ $1 == "help" ]; then
show_usage
exit 0
fi
jcmd=$1
shift 1
params=$@
case $jcmd in
list)
jamlist $params
;;
term)
jamterm $params
;;
kill)
jamkill $params
;;
clean)
jamclean $params
;;
run)
jamrun $params
;;
install)
jaminstall $params
;;
esac