AmneziaWG — различия между версиями

Материал из База знаний
Перейти к: навигация, поиск
Строка 6: Строка 6:
  
  
 +
<pre>
 +
#!/bin/bash
 +
# From: https://github.com/openwrt-xiaomi/awg-openwrt/wiki/AmneziaWG-installing
  
#!/bin/bash
+
if [ "$1" == "" ]; then
 +
  echo -e "\n VPN Client configs:"
 +
  cat /etc/amnezia/amneziawg/awg0.conf | grep "_Name" | sed "s/^.* = /\t/"
 +
  echo -e "=================================="
 +
  echo -e "\n\tUsage: $0 <UserName>\n"
 +
  exit 1
 +
fi
  
# https://github.com/openwrt-xiaomi/awg-openwrt/wiki/AmneziaWG-installing
+
cd /etc/amnezia/clients
 +
python3 awgcfg.py -a $1 2>/dev/null
 +
python3 awgcfg.py -c
 +
awg-quick down awg0
 +
awg-quick up awg0
  
if [ "$1" == "" ]; then
+
echo -e "\nClient config for AmneziaWG:"
  echo -e "\n VPN Client configs:"
+
echo -e "==================================\n"
  cat /etc/amnezia/amneziawg/awg0.conf | grep "_Name" | sed "s/^.* = /\t/"
+
cat /etc/amnezia/clients/$1.conf
  echo -e "=================================="
+
echo -e "==================================\n"
  echo -e "\n\tUsage: $0 <UserName>\n"
 
  exit 1
 
fi
 
 
 
cd /etc/amnezia/clients
 
python3 awgcfg.py -a $1 2>/dev/null
 
python3 awgcfg.py -c
 
awg-quick down awg0
 
awg-quick up awg0
 
 
 
echo -e "\nClient config for AmneziaWG:"
 
echo -e "==================================\n"
 
cat /etc/amnezia/clients/$1.conf
 
echo -e "==================================\n"
 
  
 
qrencode -t ansiutf8 -r $1.conf
 
qrencode -t ansiutf8 -r $1.conf
 
rm -f *.conf
 
rm -f *.conf
 +
</pre>

Версия 13:11, 6 декабря 2025


https://docs.amnezia.org/ru/documentation/amnezia-wg

https://github.com/openwrt-xiaomi/awg-openwrt/wiki/AmneziaWG-installing


#!/bin/bash
# From: https://github.com/openwrt-xiaomi/awg-openwrt/wiki/AmneziaWG-installing

if [ "$1" == "" ]; then
  echo -e "\n VPN Client configs:"
  cat /etc/amnezia/amneziawg/awg0.conf | grep "_Name" | sed "s/^.* = /\t/"
  echo -e "=================================="
  echo -e "\n\tUsage: $0 <UserName>\n"
  exit 1
fi

cd /etc/amnezia/clients
python3 awgcfg.py -a $1 2>/dev/null
python3 awgcfg.py -c
awg-quick down awg0
awg-quick up awg0

echo -e "\nClient config for AmneziaWG:"
echo -e "==================================\n"
cat /etc/amnezia/clients/$1.conf
echo -e "==================================\n"

qrencode -t ansiutf8 -r $1.conf
rm -f *.conf