Files
tor-guard-relay/tools/fingerprint
2025-12-05 20:24:55 +08:00

36 lines
1.4 KiB
Bash

#!/bin/sh
# Show relay fingerprint
FINGERPRINT_FILE="${TOR_DATA_DIR:-/var/lib/tor}/fingerprint"
if [ -f "$FINGERPRINT_FILE" ]; then
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔑 Relay Fingerprint"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
NICKNAME=$(cat "$FINGERPRINT_FILE" | awk '{print $1}')
FINGERPRINT=$(cat "$FINGERPRINT_FILE" | awk '{print $2}')
echo " 🪪 Nickname: $NICKNAME"
echo " 🔐 Fingerprint: $FINGERPRINT"
echo ""
echo " 📋 Copy/paste: $NICKNAME $FINGERPRINT"
echo ""
echo " 🔍 Find on Tor Metrics:"
echo " https://metrics.torproject.org/rs.html#search/$FINGERPRINT"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
else
echo ""
echo "⏳ Fingerprint not yet generated"
echo ""
echo "The fingerprint is created after Tor starts. Please wait a moment"
echo "and try again. Check status with: docker exec <container> status"
echo ""
exit 1
fi