Upload 4 files
Browse files
start.sh
CHANGED
|
@@ -87,15 +87,20 @@ detect_cmd() {
|
|
| 87 |
return 1
|
| 88 |
}
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
-
echo "Starting CLIProxyAPI: ${CLI_CMD}"
|
| 98 |
-
sh -c "${CLI_CMD}" &
|
|
|
|
| 99 |
|
| 100 |
echo "Starting nginx on port ${PORT}, proxy path ${PROXY_PATH}"
|
| 101 |
exec nginx -g 'daemon off;'
|
|
|
|
| 87 |
return 1
|
| 88 |
}
|
| 89 |
|
| 90 |
+
if [ "$#" -gt 0 ]; then
|
| 91 |
+
echo "Starting CLIProxyAPI from base CMD: $*"
|
| 92 |
+
"$@" &
|
| 93 |
+
else
|
| 94 |
+
CLI_CMD="$(detect_cmd || true)"
|
| 95 |
+
if [ -z "${CLI_CMD}" ]; then
|
| 96 |
+
echo "Cannot detect how to start CLIProxyAPI."
|
| 97 |
+
echo "Set CLI_PROXY_CMD in Space Variables to the correct launch command."
|
| 98 |
+
exit 1
|
| 99 |
+
fi
|
| 100 |
|
| 101 |
+
echo "Starting CLIProxyAPI: ${CLI_CMD}"
|
| 102 |
+
sh -c "${CLI_CMD}" &
|
| 103 |
+
fi
|
| 104 |
|
| 105 |
echo "Starting nginx on port ${PORT}, proxy path ${PROXY_PATH}"
|
| 106 |
exec nginx -g 'daemon off;'
|