diff --git a/Dockerfile b/Dockerfile index f20d8f6..3cdfb32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,6 @@ RUN mkdir /lnd/ /secrets/ /statuses/ COPY switch.sh /usr/local/bin/switch RUN chmod +x /usr/local/bin/switch +STOPSIGNAL SIGINT + ENTRYPOINT ["/usr/local/bin/switch"] diff --git a/switch.sh b/switch.sh index 54018a7..d234c69 100755 --- a/switch.sh +++ b/switch.sh @@ -15,6 +15,10 @@ # Output: /statuses/node-status-bitcoind-ready (when ready, where a service can pick it up) +# Trap signal SIGINT - Explicitly define it +trap exit INT + +# Setup environment variables RPCUSER="${RPCUSER:-lncm}" # Default Username: lncm RPCPASS="${RPCPASS:-$(cat /secrets/rpcpass.txt)}" # Default password location: /secrets/rpcpass.txt SLEEPTIME="${SLEEPTIME:-3600}" # Default sleep: 3600