Files
local_machine/docs/connectivity/vpn/scripts/get-wg-ru-config.sh
2026-03-14 20:03:57 +03:00

22 lines
883 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Скрипт для получения конфигурации WireGuard с ru.hunab.app
# Использование: ./get-wg-ru-config.sh
SERVER="ahau@149.154.64.19"
CONFIG_PATH="/opt/app/vpn/wireguard/config/peer1/peer1.conf"
OUTPUT_FILE="docs/vpn/wg-ru.conf"
echo "Получение конфигурации WireGuard с $SERVER..."
scp "$SERVER:$CONFIG_PATH" "$OUTPUT_FILE" 2>/dev/null
if [ -f "$OUTPUT_FILE" ] && [ -s "$OUTPUT_FILE" ]; then
echo "✅ Конфигурация получена: $OUTPUT_FILE"
echo ""
echo "=== Содержимое конфигурации ==="
cat "$OUTPUT_FILE"
else
echo "⚠️ Конфигурация не найдена на сервере"
echo "Сначала выполните развертывание на сервере:"
echo " cat docs/vpn/ONE_LINE_DEPLOY.txt | ssh $SERVER"
fi