mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-07 08:04:23 +01:00
This is based on @NicolasDorier's excellent proposal for a Dockerfile, sans the writing of a config file. Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com> Co-authored-by: Christian Decker <decker.christian@gmail.com> Signed-off-by: Christian Decker <decker.christian@gmail.com>
19 lines
482 B
Bash
Executable File
19 lines
482 B
Bash
Executable File
#!/bin/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"
|
|
|
|
socat "TCP4-listen:$LIGHTNINGD_PORT,fork,reuseaddr" "UNIX-CONNECT:$LIGHTNINGD_DATA/lightning-rpc" &
|
|
fg %-
|
|
else
|
|
lightningd "$@"
|
|
fi
|