#!/usr/bin/env bash # The Multi-Server Finger Monitor / Blue Oak Model License 1.0.0 # Displays activity from three core finger servers: # https://640kb.neocities.org/fingerverse/index.html # Changelog: # 3.1 (07dec2025) : Formatted code for better readability. # 3.0 (28nov2025) : Added blocklist feature # 2.6 (10oct2025) : Added CLIENT_NAME variable; general cleanup # Original/inhouse: (finger @happynetbox.com | sed -n '5,10p'; finger @plan.cat | sed -n '2,7p') # usage: fm # --------------------------------------------------------------------------- # Change this to your preferred command-line finger client: CLIENT_NAME="finger" # Blocklist - add accounts you don't want to see (format: username@server) BLOCKLIST=( "trollacct1@happynetbox.com" "trollacct2@plan.cat" "trollacct3@thebackupbox.net" # "trollacct4@plan.cat" # "trollacct5@thebackupbox.net" # Add more entries as needed ) filter_blocked() { local content="$1" local server="$2" if [ ${#BLOCKLIST[@]} -eq 0 ]; then echo "$content" return fi while IFS= read -r line; do local blocked=0 for blocked_account in "${BLOCKLIST[@]}"; do [[ -z "$blocked_account" || "$blocked_account" =~ ^[[:space:]]*# ]] && continue if [[ "$blocked_account" == *"@$server" ]] && [[ "$line" == *"${blocked_account%@*}"* ]]; then blocked=1 break fi done [ $blocked -eq 0 ] && echo "$line" done <<< "$content" } format_output() { header="$1" content="$2" server="$3" printf "\n%s\n" "$header" filtered_content=$(filter_blocked "$content" "$server" | head -n 6) case "$server" in "happynetbox.com") echo "$filtered_content" | sed 's/^> //' ;; "plan.cat") echo "$filtered_content" | awk '{ username = $1; timestamp = $(NF-4)" "$(NF-3)" "$(NF-2)" "$(NF-1)" "$NF; printf "%-20s %s\n", username, timestamp }' ;; "thebackupbox.net") echo "$filtered_content" | tr -d '\r' | awk -F'[/ ]+' '{ date_part = $2; username = $NF; url = substr($0, index($0, "finger://")); printf "%-20s %-15s %s\n", username, date_part, url }' ;; esac } monitor_servers() { # Query happynetbox.com (user updates; extra lines (re: version 3.0)) happynetbox=$($CLIENT_NAME @happynetbox.com 2>/dev/null | sed -n '5,15p') format_output "----- happynetbox.com ----" "$happynetbox" "happynetbox.com" # Query plan.cat (with full timestamps; extra lines (re: version 3.0)) plancat=$($CLIENT_NAME @plan.cat 2>/dev/null | sed -n '2,12p') format_output "-------- plan.cat --------" "$plancat" "plan.cat" # Query thebackupbox.net (Finger Ring status; extra lines (re: version 3.0)) backupbox=$($CLIENT_NAME ring@thebackupbox.net 2>/dev/null | sed -n '20,35p') format_output "---- thebackupbox.net ----" "$backupbox" "thebackupbox.net" } if ! monitor_servers; then echo "Error: Failed to query one or more finger servers" >&2 exit 1 fi echo -e "\n--------------------------" exit 0