-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathpacketproxy-cli
More file actions
executable file
·33 lines (25 loc) · 975 Bytes
/
packetproxy-cli
File metadata and controls
executable file
·33 lines (25 loc) · 975 Bytes
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
#!/usr/bin/env bash
set -e
# Description:
# A packet normalization proxy designed for integration with other tools.
# Options:
# log Launch directly in log streaming mode.
# Useful for observing traffic in real-time.
# (Note: In this mode, Ctrl+C terminates the application.)
# Default Behavior:
# If no arguments are provided, the tool starts in an interactive shell mode.
readonly PROJECT_ROOT=$(cd $(dirname "$0") && pwd)
readonly TARGET_BIN="$PROJECT_ROOT/build/install/PacketProxy/bin/PacketProxy"
PRE_EXEC_SCRIPT="$1"
case "$1" in
"") ;; # default
/* | ./*) ;; # shebang
*) PRE_EXEC_SCRIPT="$(find "$PROJECT_ROOT/scripts" -type f -name "$1.pp")" ;;
esac
"$PROJECT_ROOT/gradlew" -p "$PROJECT_ROOT" installDist --quiet
test -f "$TARGET_BIN"
if test -n "$PRE_EXEC_SCRIPT"; then
test -f "$PRE_EXEC_SCRIPT"
fi
export JAVA_OPTS="-Dapp.home=$PROJECT_ROOT"
exec "$TARGET_BIN" --settings-json="$SETTINGS_JSON" --gulp="$PRE_EXEC_SCRIPT"