-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathentrypoint.sh
More file actions
30 lines (25 loc) · 804 Bytes
/
Copy pathentrypoint.sh
File metadata and controls
30 lines (25 loc) · 804 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
#!/bin/sh
set -e
# Check if Pangolin environment variables are set
if [ -n "$PANGOLIN_ENDPOINT" ] && [ -n "$CLIENT_ID" ] && [ -n "$CLIENT_SECRET" ]; then
# Run pangolin-cli up --attach with the provided credentials
exec pangolin-cli up --attach --id "$CLIENT_ID" --secret "$CLIENT_SECRET" --endpoint "$PANGOLIN_ENDPOINT" "$@"
fi
# If no arguments provided, run pangolin-cli with default behavior
if [ $# -eq 0 ]; then
exec pangolin-cli
fi
# If first arg is a flag (starts with -), prepend pangolin-cli
if [ "${1#-}" != "$1" ]; then
exec pangolin-cli "$@"
fi
# If first arg is a shell or absolute path, execute as-is
case "$1" in
sh|bash|/*)
exec "$@"
;;
*)
# Otherwise, treat as a pangolin-cli subcommand
exec pangolin-cli "$@"
;;
esac