-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathevilvm
executable file
·51 lines (45 loc) · 1.23 KB
/
evilvm
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
#!/bin/bash
# shameless ripped off from:
# https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
export ROOT
if [ "$?" -ne "0" ] ; then
echo "Cannot change to script directory"
exit 2
fi
function usage() {
echo
echo " usage: evilvm [command] [args ...]"
echo
echo " This script controls execution of EvilVM's various components."
echo " Each component will show help and usage information if run"
echo " with no arguments."
echo
echo " Available components:"
echo
echo " server run the central EvilVM server console"
echo " shim run a protocol shim for non-TCP transports"
echo " build build EvilVM agents for deployment"
echo
exit 1
}
case $1 in
"server")
exec bash ${ROOT}/scripts/server.sh "$@"
;;
"shim")
exec bash ${ROOT}/scripts/shim.sh "$@"
;;
"build")
exec bash ${ROOT}/scripts/build.sh "$@"
;;
*)
usage
;;
esac