mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-05 21:44:42 +01:00
f8fa4213f1
These commands fail on systems that do not have bash under /bin Signed-off-by: William Casarin <jb55@jb55.com>
20 lines
569 B
Bash
Executable File
20 lines
569 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
: "${EXPOSE_TCP:=false}"
|
|
|
|
if [ "$EXPOSE_TCP" == "true" ]; then
|
|
set -m
|
|
lightningd "$@" &
|
|
|
|
echo "C-Lightning starting"
|
|
while read -r i; do if [ "$i" = "lightning-rpc" ]; then break; fi; done \
|
|
< <(inotifywait -e create,open --format '%f' --quiet "$LIGHTNINGD_DATA" --monitor)
|
|
echo "C-Lightning started"
|
|
echo "C-Lightning started, RPC available on port $LIGHTNINGD_RPC_PORT"
|
|
|
|
socat "TCP4-listen:$LIGHTNINGD_RPC_PORT,fork,reuseaddr" "UNIX-CONNECT:$LIGHTNINGD_DATA/lightning-rpc" &
|
|
fg %-
|
|
else
|
|
lightningd "$@"
|
|
fi
|