|
@@ -1,37 +1,31 @@
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
port=9009
|
|
|
mtu=1200
|
|
|
host=$(hostname -s)
|
|
|
|
|
|
ip_list=(2 8 18 88 188 118 158 198 168 186)
|
|
|
|
|
|
-
|
|
|
|
|
|
if [ $host == "debian" ]; then
|
|
|
apt update && apt install -y curl
|
|
|
fi
|
|
|
+serverip=$(curl -4 icanhazip.com)
|
|
|
|
|
|
|
|
|
apt -y install qrencode
|
|
|
-
|
|
|
-serverip=$(curl -4 icanhazip.com)
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
@@ -58,7 +52,6 @@ AllowedIPs = 10.0.0.2/32
|
|
|
|
|
|
EOF
|
|
|
|
|
|
-
|
|
|
|
|
|
cat <<EOF >client.conf
|
|
|
[Interface]
|
|
@@ -107,26 +100,22 @@ EOF
|
|
|
cat /etc/wireguard/wg_${host}_$i.conf| qrencode -o wg_${host}_$i.png
|
|
|
done
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-if [ $host == "vultr" ]; then
|
|
|
- sed -i "s/eth0/ens3/g" /etc/wireguard/wg0.conf
|
|
|
+
|
|
|
+ni=$(ls /sys/class/net | awk {print} | head -n 1)
|
|
|
+if [ $ni != "eth0" ]; then
|
|
|
+ sed -i "s/eth0/${ni}/g" /etc/wireguard/wg0.conf
|
|
|
fi
|
|
|
|
|
|
-
|
|
|
|
|
|
wg-quick down wg0
|
|
|
wg-quick up wg0
|
|
|
wg
|
|
|
|
|
|
-
|
|
|
cat <<EOF >wg5
|
|
|
|
|
|
-
|
|
|
next() {
|
|
|
printf "# %-70s\n" "-" | sed 's/\s/-/g'
|
|
|
}
|
|
|
-
|
|
|
host=$(hostname -s)
|
|
|
|
|
|
cd /etc/wireguard/
|