arch logs, fix

This commit is contained in:
Justin (shocknet) 2024-08-07 16:10:57 -04:00
parent 421873a7de
commit a15de6d55a
2 changed files with 15 additions and 11 deletions

View file

@ -29,18 +29,19 @@ get_log_info() {
exit 1
fi
# Get the initial line count
initial_lines=$(wc -l < "$latest_unlocker_log")
# Get the initial file size instead of line count
initial_size=$(stat -c %s "$latest_unlocker_log")
# Wait for new wallet status in log file
while [ $(($(date +%s) - START_TIME)) -lt $MAX_WAIT_TIME ]; do
current_lines=$(wc -l < "$latest_unlocker_log")
if [ $current_lines -gt $initial_lines ]; then
latest_entry=$(tail -n $((current_lines - initial_lines)) "$latest_unlocker_log" | grep -E "unlocker >> (the wallet is already unlocked|created wallet with pub|unlocked wallet with pub)" | tail -n 1)
current_size=$(stat -c %s "$latest_unlocker_log")
if [ $current_size -gt $initial_size ]; then
latest_entry=$(tail -c +$((initial_size + 1)) "$latest_unlocker_log" | grep -E "unlocker >> (the wallet is already unlocked|created wallet with pub|unlocked wallet with pub)" | tail -n 1)
if [ -n "$latest_entry" ]; then
break
fi
fi
initial_size=$current_size
sleep $WAIT_INTERVAL
done
@ -79,7 +80,7 @@ get_log_info() {
fi
elif [ -f "$DATA_DIR/app.nprofile" ]; then
app_nprofile=$(cat "$DATA_DIR/app.nprofile")
log "Node is already set up. Use this nprofile to invite guestusers:"
log "Node is already set up. Use this nprofile to invite guest users:"
log "${SECONDARY_COLOR}$app_nprofile${RESET_COLOR}"
break
fi

View file

@ -23,14 +23,17 @@ modules=(
)
for module in "${modules[@]}"; do
wget -q "${BASE_URL}/${module}.sh" -O "/tmp/${module}.sh"
source "/tmp/${module}.sh"
wget -q "${BASE_URL}/${module}.sh" -O "/tmp/${module}.sh" || log_error "Failed to download ${module}.sh" 1
source "/tmp/${module}.sh" || log_error "Failed to source ${module}.sh" 1
done
detect_os_arch
log "Detected OS: $OS"
log "Detected ARCH: $ARCH"
if [ "$OS" = "Mac" ]; then
handle_macos
log "Handling macOS specific setup"
handle_macos || log_error "macOS setup failed" 1
else
lnd_output=$(install_lnd)
install_result=$?
@ -71,8 +74,8 @@ else
fi
log "Starting services..."
start_services $lnd_status $pub_upgrade_status
get_log_info
start_services $lnd_status $pub_upgrade_status || log_error "Failed to start services" 1
get_log_info || log_error "Failed to get log info" 1
log "Installation process completed successfully"
fi