From 18333d91408ab74412e2dfec21fa81f2ae081bf9 Mon Sep 17 00:00:00 2001 From: Elyan Date: Sun, 18 Feb 2024 04:01:52 -0800 Subject: [PATCH] Add bashrc file as an alais for interactive shell --- .bashrc | 11 +++++++++++ Dockerfile | 3 +++ logtail.sh | 12 ++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 .bashrc create mode 100644 logtail.sh diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..35cad81 --- /dev/null +++ b/.bashrc @@ -0,0 +1,11 @@ +# Use bash completion, if available +alais bitcoin-cli="bitcoin-cli -datadir=/root/signet-custom" + +# Check if an interactive shell is running +if [ -n "$PS1" ]; then + # Source bash completion, if its available + if [ -f /usr/share/bash-completion/bash_completion]; then + ./usr/share/bash-completion/bash_completion + + fi + fi diff --git a/Dockerfile b/Dockerfile index 23e3808..16a3ebb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,9 @@ COPY bitcoin.conf /root/.bitcoin/bitcoin.conf COPY --from=0 /bitcoin/contrib/signet/miner.py /usr/local/bin/ RUN chmod +x /usr/local/bin/miner.py +# Copy the .bashrc file to the container's root directory +COPY .bashrc /root/.bashrc + # Copy the logtail.sh script COPY logtail.sh . RUN chmod +x logtail.sh diff --git a/logtail.sh b/logtail.sh new file mode 100644 index 0000000..7dca5a2 --- /dev/null +++ b/logtail.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -Eeuo pipefail + +# Define the path to your Bitcoin data directory +DATADIR="/root/signet-custom" + +# Ensure the debug.log file exists +touch $DATADIR/debug.log + +# Show and Tail Bitcoin debug log +tail -n +1 -f $DATADIR/debug.log || true +echo "Tailing the Bitcoin debug log. press Ctrl+c to stop."