2018-07-24 00:06:04 +02:00
|
|
|
#!/usr/bin/env bash
|
2018-06-21 17:42:52 +02:00
|
|
|
|
|
|
|
: "${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"
|
2018-06-26 02:17:53 +02:00
|
|
|
echo "C-Lightning started, RPC available on port $LIGHTNINGD_RPC_PORT"
|
2018-06-21 17:42:52 +02:00
|
|
|
|
2018-06-26 02:17:53 +02:00
|
|
|
socat "TCP4-listen:$LIGHTNINGD_RPC_PORT,fork,reuseaddr" "UNIX-CONNECT:$LIGHTNINGD_DATA/lightning-rpc" &
|
2018-06-21 17:42:52 +02:00
|
|
|
fg %-
|
|
|
|
else
|
2018-12-20 05:18:51 +01:00
|
|
|
exec lightningd "$@"
|
2018-06-21 17:42:52 +02:00
|
|
|
fi
|