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

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

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


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

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


#!/bin/bash
# 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