modified main script to output into subdir
added gitignore forgot to exclude the gitignore from gitignore so yeah...
This commit is contained in:
parent
01eb0f54df
commit
914833c7b8
|
|
@ -0,0 +1,4 @@
|
||||||
|
0*
|
||||||
|
client-*
|
||||||
|
!0*.def
|
||||||
|
!1*
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/ash
|
#!/bin/ash
|
||||||
|
|
||||||
|
OutputDir="clients/"
|
||||||
|
|
||||||
EnvironmentFile="0connection-info.env"
|
EnvironmentFile="0connection-info.env"
|
||||||
echo "[*] Using server information from file \"$EnvironmentFile\""
|
echo "[*] Using server information from file \"$EnvironmentFile\""
|
||||||
if [ ! -f "$EnvironmentFile" ]
|
if [ ! -f "$EnvironmentFile" ]
|
||||||
|
|
@ -16,6 +18,7 @@ read Ip
|
||||||
|
|
||||||
|
|
||||||
umask 077;
|
umask 077;
|
||||||
|
cd "clients"
|
||||||
wg genkey | tee "client-$Name" | wg pubkey > "client-$Name.pub"; wg genpsk > "client-$Name.psk";
|
wg genkey | tee "client-$Name" | wg pubkey > "client-$Name.pub"; wg genpsk > "client-$Name.psk";
|
||||||
echo "[*] Generated Keys"
|
echo "[*] Generated Keys"
|
||||||
|
|
||||||
|
|
@ -43,8 +46,8 @@ PublicKey = $(cat "client-$Name.pub")
|
||||||
PresharedKey = $(cat "client-$Name.psk")
|
PresharedKey = $(cat "client-$Name.psk")
|
||||||
AllowedIPs = "$Ip/32"
|
AllowedIPs = "$Ip/32"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo;
|
echo;
|
||||||
echo "[*] Generated server lines and outputed to file \"client-$Name.srv\""
|
echo "[*] Generated server lines and outputed to file \"${OutputDir}client-$Name.srv\""
|
||||||
|
cd ..
|
||||||
umask 022;
|
umask 022;
|
||||||
echo "[*] All done!"
|
echo "[*] All done!"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue