mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
f9f4ed8e11
In conjunction to https://github.com/ElementsProject/lightning/pull/2172 this fix https://github.com/ElementsProject/lightning/issues/2074 if EXPOSE_TCP is false (which is the case in production) More info https://github.com/ElementsProject/lightning/pull/2172#issuecomment-447727668
20 lines
574 B
Bash
Executable File
20 lines
574 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
|
|
exec lightningd "$@"
|
|
fi
|