mac fixes

This commit is contained in:
shocknet-justin 2025-11-26 23:34:07 -05:00
parent 67425e6c22
commit 1f119e1419
3 changed files with 6 additions and 14 deletions

View file

@ -96,6 +96,7 @@ install_lightning_pub() {
LND_ADDRESS=127.0.0.1:10009 LND_ADDRESS=127.0.0.1:10009
LND_CERT_PATH=$HOME/Library/Application Support/Lnd/tls.cert 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_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 EOF
fi fi
fi fi

View file

@ -4,8 +4,6 @@ install_lnd() {
local status_file="$1" local status_file="$1"
local lnd_status=0 local lnd_status=0
log "Starting LND installation/check process..."
USER_HOME=$HOME USER_HOME=$HOME
USER_NAME=$(whoami) USER_NAME=$(whoami)
@ -16,33 +14,27 @@ install_lnd() {
LND_DIR="$USER_HOME/.lnd" LND_DIR="$USER_HOME/.lnd"
fi fi
log "Checking latest LND version..."
LND_VERSION=$(get_latest_release_tag "lightningnetwork/lnd") LND_VERSION=$(get_latest_release_tag "lightningnetwork/lnd")
if [ -z "$LND_VERSION" ]; then if [ -z "$LND_VERSION" ]; then
log "${PRIMARY_COLOR}Failed to fetch latest LND version.${RESET_COLOR}" log "${PRIMARY_COLOR}Failed to fetch latest LND version.${RESET_COLOR}"
exit 1 exit 1
fi fi
log "Latest LND version: $LND_VERSION"
local LND_OS="$OS"; [ "$OS" = "Mac" ] && LND_OS="darwin" 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" 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 # Check if LND is already installed
if [ -d "$USER_HOME/lnd" ]; then if [ -d "$USER_HOME/lnd" ]; then
log "LND directory found. Checking current version..."
CURRENT_VERSION=$("$USER_HOME/lnd/lnd" --version | awk '/version/ {print $3}') CURRENT_VERSION=$("$USER_HOME/lnd/lnd" --version | awk '/version/ {print $3}')
log "Current LND version: $CURRENT_VERSION"
if [ "$CURRENT_VERSION" == "${LND_VERSION#v}" ]; then 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 lnd_status=2 # Set status to 2 to indicate no action needed
else 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 lnd_status=1 # Set status to 1 to indicate upgrade
fi fi
else
log "LND not found. Proceeding with fresh installation..."
fi fi
if [ $lnd_status -eq 0 ] || [ $lnd_status -eq 1 ]; then if [ $lnd_status -eq 0 ] || [ $lnd_status -eq 1 ]; then

View file

@ -23,18 +23,17 @@ install_nodejs_mac() {
fi fi
fi fi
log "Node.js is not installed or outdated. ${PRIMARY_COLOR}Installing...${RESET_COLOR}"
# Get latest LTS version from Node.js # Get latest LTS version from Node.js
local node_index=$(download_stdout "https://nodejs.org/dist/index.json") 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 if [ -z "$lts_version" ]; then
log "Failed to fetch Node.js LTS version." log "Failed to fetch Node.js LTS version."
return 1 return 1
fi fi
log "Installing Node.js ${lts_version}..." log "${PRIMARY_COLOR}Installing${RESET_COLOR} Node.js ${lts_version}..."
local node_arch="x64" local node_arch="x64"
[ "$ARCH" = "arm64" ] && node_arch="arm64" [ "$ARCH" = "arm64" ] && node_arch="arm64"