diff --git a/scripts/install_lightning_pub.sh b/scripts/install_lightning_pub.sh index 4577a485..d05765fc 100755 --- a/scripts/install_lightning_pub.sh +++ b/scripts/install_lightning_pub.sh @@ -96,6 +96,7 @@ install_lightning_pub() { LND_ADDRESS=127.0.0.1:10009 LND_CERT_PATH=$HOME/Library/Application Support/Lnd/tls.cert LND_MACAROON_PATH=$HOME/Library/Application Support/Lnd/data/chain/bitcoin/mainnet/admin.macaroon +LND_LOG_DIR=$HOME/Library/Application Support/Lnd/logs/bitcoin/mainnet EOF fi fi diff --git a/scripts/install_lnd.sh b/scripts/install_lnd.sh index 13c87f59..126471b0 100755 --- a/scripts/install_lnd.sh +++ b/scripts/install_lnd.sh @@ -4,8 +4,6 @@ install_lnd() { local status_file="$1" local lnd_status=0 - log "Starting LND installation/check process..." - USER_HOME=$HOME USER_NAME=$(whoami) @@ -16,33 +14,27 @@ install_lnd() { LND_DIR="$USER_HOME/.lnd" fi - log "Checking latest LND version..." LND_VERSION=$(get_latest_release_tag "lightningnetwork/lnd") if [ -z "$LND_VERSION" ]; then log "${PRIMARY_COLOR}Failed to fetch latest LND version.${RESET_COLOR}" exit 1 fi - log "Latest LND version: $LND_VERSION" local LND_OS="$OS"; [ "$OS" = "Mac" ] && LND_OS="darwin" LND_URL="https://github.com/lightningnetwork/lnd/releases/download/${LND_VERSION}/lnd-${LND_OS}-${ARCH}-${LND_VERSION}.tar.gz" # Check if LND is already installed if [ -d "$USER_HOME/lnd" ]; then - log "LND directory found. Checking current version..." CURRENT_VERSION=$("$USER_HOME/lnd/lnd" --version | awk '/version/ {print $3}') - log "Current LND version: $CURRENT_VERSION" if [ "$CURRENT_VERSION" == "${LND_VERSION#v}" ]; then - log "${SECONDARY_COLOR}LND${RESET_COLOR} is already up-to-date (version $CURRENT_VERSION)." + log "${SECONDARY_COLOR}LND${RESET_COLOR} is already up-to-date (${LND_VERSION})." lnd_status=2 # Set status to 2 to indicate no action needed else - log "${PRIMARY_COLOR}Upgrading${RESET_COLOR} ${SECONDARY_COLOR}LND${RESET_COLOR} from version $CURRENT_VERSION to $LND_VERSION..." + log "${PRIMARY_COLOR}Upgrading${RESET_COLOR} ${SECONDARY_COLOR}LND${RESET_COLOR} from ${CURRENT_VERSION} to ${LND_VERSION}..." lnd_status=1 # Set status to 1 to indicate upgrade fi - else - log "LND not found. Proceeding with fresh installation..." fi if [ $lnd_status -eq 0 ] || [ $lnd_status -eq 1 ]; then diff --git a/scripts/install_nodejs.sh b/scripts/install_nodejs.sh index e23dc11a..aebcc368 100755 --- a/scripts/install_nodejs.sh +++ b/scripts/install_nodejs.sh @@ -23,18 +23,17 @@ install_nodejs_mac() { fi fi - log "Node.js is not installed or outdated. ${PRIMARY_COLOR}Installing...${RESET_COLOR}" - # Get latest LTS version from Node.js local node_index=$(download_stdout "https://nodejs.org/dist/index.json") - local lts_version=$(echo "$node_index" | grep -o '"version":"v[0-9.]*"[^}]*"lts":"[^"]*"' | grep -v '"lts":false' | awk -F'"' '{print $4; exit}') + local lts_line=$(printf '%s' "$node_index" | grep -o '"version":"v[0-9.]*"[^}]*"lts":"[A-Za-z]*"' | grep -v '"lts":false' | head -1) + local lts_version=$(printf '%s' "$lts_line" | awk -F'"' '{print $4}') if [ -z "$lts_version" ]; then log "Failed to fetch Node.js LTS version." return 1 fi - log "Installing Node.js ${lts_version}..." + log "${PRIMARY_COLOR}Installing${RESET_COLOR} Node.js ${lts_version}..." local node_arch="x64" [ "$ARCH" = "arm64" ] && node_arch="arm64"